【问题标题】:sending an email using localhost with MAMP使用带有 MAMP 的 localhost 发送电子邮件
【发布时间】:2016-03-28 17:53:00
【问题描述】:

所以基本上我正在尝试通过本地主机发送电子邮件,而我使用的程序是 MAMP。我已经在网上查找并完成了所有编写的操作,但是这仍然行不通。我的 Apache 端口设置为:8888 我的 SQL 端口设置为:3306 我作为 php 文件输入的发送电子邮件的功能如下:

mail(
     $admin_email, $messaage,
     'Works!',
     'An email has been generated from your localhost, congratulations!');

此外,我已经填写了所有发送邮件的值,如下所示:

smtp_server=smtp.gmail.com
; smtp port (normally 25)

smtp_port=25
smtp_ssl=ssl
auth_username=my_email@gmail.com
auth_password=*******

hostname=localhost

显然 - 我的电子邮件和密码是使用我的电子邮件和密码填写的。我也改变了 php.ini 文件,如下所示:

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;http://php.net/sendmail-path
sendmail_path = C:\Windows\System32\sendmail\ -t -i -f   my_email@gmail.com

谁能告诉我我的错误在哪里?非常感谢任何帮助:)

【问题讨论】:

    标签: php email sendmail


    【解决方案1】:
    [mail function]
    ; For Win32 only.
    ;SMTP = localhost
    ;smtp_port = 25
    
    ; For Win32 only.
    ;sendmail_from = don@tripleroi.com
    
    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    sendmail_path =/usr/sbin/sendmail -t -i -f  yourname@example.com
    

    如果你用的是gmail,那么

        'host' = 'ssl://smtp.gmail.com',
        'port' = '465',
    

    注意:发送邮件时必须登录

    【讨论】:

    • 登录是什么意思?
    • 当您通过电子邮件发送时,您必须登录到此帐户。
    猜你喜欢
    • 2018-03-18
    • 2012-05-07
    • 2014-05-20
    • 2016-09-20
    • 2013-03-28
    • 2013-08-13
    • 2016-12-11
    • 2011-10-07
    • 2017-06-19
    相关资源
    最近更新 更多