php mail on MAMP

后端 未结 6 1947
栀梦
栀梦 2020-12-10 11:23

I need to test some script using PHP\'s mail. I\'d like to be able to finally get this working locally. I am using MAMP. Is there a way to do this without installing any thi

6条回答
  •  我在风中等你
    2020-12-10 12:15

    what i do is i use the phpmailer class (warning: horrible website !) and specify a real smtp server on which i have an account. So i don't use mail() but use smtp. In this way, it does not matter whether i'm on my local server or on the real server. But you do need a working smtp access to that smtp mail server. Best would be to actually use the production mail server (the one that will be used by your application when it goes live). In this manner, you won't have last minute surprises when you discover that the mailserver messes up the reply-to field and little things like that.

提交回复
热议问题