XAMPP mail not working with PHP mail() function

前端 未结 3 1239
误落风尘
误落风尘 2021-01-03 12:56

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);

3条回答
  •  情书的邮戳
    2021-01-03 13:17

    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)

提交回复
热议问题