简体   繁体   English

PHP-通过gmail发送邮件?

[英]PHP - Sending mail with through gmail?

Is there any way to send mail from a gmail account to someone? 有什么办法可以从Gmail帐户向某人发送邮件? And by "from" i mean so that it stores the email in the gmail inbox aswell...? 而“发件人”是指它也将电子邮件存储在gmail收件箱中...?

I've tried using imap, but i'm not sure if that's the correct way? 我已经尝试过使用imap,但是我不确定这是否正确吗? Either way i get this error: 无论哪种方式,我都会收到此错误:

Warning: imap_mail() [function.imap-mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\gmail\index.php on line 12

Any idas how to achieve this? 任何idas如何实现这一目标?

Thanks! 谢谢!

Try using smtp instead, Gmail will put your email in sent folder for you. 尝试使用smtp,Gmail会将您的电子邮件放入已发送的文件夹中。 All the instructions are provided in the settings page of your gmail account. 所有说明均在您的gmail帐户的设置页面中提供。

http://deepakssn.blogspot.com/2006/06/gmail-php-send-email-using-php-with.html http://deepakssn.blogspot.com/2006/06/gmail-php-send-email-using-php-with.html

您可以执行电子邮件客户端相同的操作:通过SMTP发送邮件,然后通过IMAP在“已发送”文件夹中创建邮件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM