I just installed XAMPP, Apache is running, so is MySQL and Mercury.
In Dreamweaver I created a php file with a mail($to,$subject,$msg,'From:'.$email);
function, but when I ran the file from localhost it showed an error. After playing around with xampp control panel, turning mercury on and off, it's not showing any errors, yet is not send the email either... any ideas?
the 'admin' button on the cp for mercury does nothing.
Thanks! R
You would have to configure the mercury server bundled with xampp to actually deliver/relay the mails.
But I suggest you use something like SwiftMailer instead of php's mail() function.
edit: there is a third option. The mini-smtp-client built into php/win32 can't do authentication. Therefore you can't simply put SMTP=mail.gmail.com; smtp_port=25
in your php.ini. But you can set sendmail_path and point to an application that can relay the message to another smtp server (including authentication), e.g. fake sendmail.
(But I still suggest swiftmailer)
You do not need to use a SMTP server like Mercury to send mails from your PHP.
I personally used two days on this matter, now expert in Mercury, almost, since it never worked with PHP.
Save a lot of time and use SWIFT MAIL, standalone solution, no SMTP server needed - the first example at this link works ! Swift mail is very elegant. Only needed is to download and add the lib folder in your php path. When the mail with the message "Wonderful Subject" ticks in the mailbox at first try, it is indeed a wonderful lib.
You have to set your SMTP server settings in the php.ini file
来源:https://stackoverflow.com/questions/2559898/xampp-mail-not-working-with-php-mail-function