简体   繁体   English

来自ubuntu的使用gmail帐户的xampp sendmail

[英]xampp sendmail using gmail account, from ubuntu

I have installed Xampp for ubuntu. 我已经为Ubuntu安装了Xampp。 It is located in /opt/lampp. 它位于/ opt / lampp中。 I want to configure the php.ini and sendmail.ini files so that i will be able to send mail using the gmail smtp server. 我想配置php.ini和sendmail.ini文件,以便能够使用gmail smtp服务器发送邮件。 The php.ini is located in /opt/lampp/etc, but I can't find the sendmail.ini file. php.ini位于/ opt / lampp / etc中,但是我找不到sendmail.ini文件。 Also most of the resources on stackoverflow were for Windows. 同样,stackoverflow上的大多数资源都用于Windows。 Could someone point out the configuration for ubuntu and xampp server. 有人可以指出ubuntu和xampp服务器的配置。 Thanks a lot. 非常感谢。

use zend_mail instead to send mail using gmail config 使用zend_mail代替使用gmail配置发送邮件

$settings = array('ssl'=>'ssl',
                                'port'=>465,
                                'auth' => 'login',
                                'username' => 'youremail@gmail.com',
                                'password' => 'YOUR_PASSWORD');
                $transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $settings);
                $email_from = "YOUR_EMAIL";
                $name_from = "YOUR NAME";
                $email_to = "TO_EMAIL";
                $name_to = "TO NAME";

                $mail = new Zend_Mail ();
                $mail->setReplyTo($email_from, $name_from);
                $mail->setFrom ($email_from, $name_from);
                $mail->addTo ($email_to, $name_to);
                $mail->setSubject ('Testing email using google accounts and Zend_Mail');
                $mail->setBodyText ("Email body");
                $mail->send($transport);

http://blog.josedasilva.net/zend-framework-sending-emails-using-zend_mail-and-google-smtp/ http://blog.josedasilva.net/zend-framework-sending-emails-using-zend_mail-and-google-smtp/

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

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