XAMPP mail not working with PHP mail() function

前端 未结 3 1238
误落风尘
误落风尘 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:27

    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.

    http://swiftmailer.org/docs/sending.html

提交回复
热议问题