Laravel
Now let's look at the examples of the documentation that should not be difficult to understand:
Mailer = $mailer; } /** * Purchase a podcast. * * @return void * /Public Function handle () { // }}
In this example, the Purchasepodcast job needs to send e-mails if a podcast is purchased. So, we'llinject a service that's able to send e-mails. Since The servi
Linux on the sendmail often due to some configuration problems, resulting in a failure to send mail, the following collation, collected some of the mail sent failed, abnormal cases. Case 1: when testing sendmail on a new server to send a message, found that the message sent is not successful, check the/var/log/maillog log file found the following error (Notice:hostname, e-mail address and other information using XXX instead) Tail/var/log/maillog May 09:43:38 xxxxx sendmail[9182]: S4f1hcqe009182
the Fsockopen, so the code is modified to:
$this->smtp_conn = stream_socket_client ("tcp://". $host ":". $port, $errno, $errstr, $tval);
Add:
Solution: Many of the Web site listed the solution is due to the problem of SMTP case, although the nature of the problem is not here, but it does need to change this place, as for why, look at the following operation.
In class.phpmailer.php, you will:
function Issmtp () {$this->mailer= ' SMTP ';}
Change
1. Configure in config file
' Mailer ' => [
' class ' => ' Yii\swiftmailer\mailer ',//server class
' Usefiletransport ' =>false,//must have, false send mail, true just generate messages under Runtime folder, do not send mail
The above configuration, according to your mailbox, to configure. 2: Inside the controller or inside the model you can call the
$FFF = Yii:: $app->
station:http://phpmailer.sourceforge.net
There are two files, one is class.smtp.php, and the other is class.phpmailer.php, using the method can refer to the following article:
Http://blog.jianqing.net/2005/05/02/201-phpmailer
Plus the official website usage:
Examples using Phpmailer
1. Advanced Example
This is demonstrates sending out multiple email messages with binary attachments from a MySQL database with Multipart/alterna tive support.
Require ("class.phpmailer.php"); $mail = new
correspond to the two time ranges in the database respectively.
Mysql_query ("set names gb2312 ");
$ Result = mysql_query ($ SQL, $ db );
While ($ row = mysql_fetch_array ($ result ))
{
Printf ($ format, $ row [0], $ row [1], $ row [2], $ row [3], $ row [4], $ row [5]);
If ($ datesy = $ row [0] | datesy = $ row [1]) // currently, if the page is refreshed at a specified point, the program will only check the $ row [1], that is, the edate Time. only one email will be taken and sent. if the
(1) The server cannot send emails using smtp.
Solution: the solution listed by many websites is due to the smtp case sensitivity problem. Although the problem is not here in essence, it must be changed. For the reason, refer to the following operations.
In class. phpmailer. php, set:
function IsSMTP(){$this->Mailer='smtp';}
Changed:
function IsSMTP(){$this->Mailer = 'SMTP';}
The modification in this place d
1. Configure in config file
' Mailer ' = [ ' class ' = ' yii\Swiftmailer\mailer ',//server class
' Usefiletransport ' =>false,//This sentence must have, false send message , true just generate mail in the runtime folder, do not send mail ' transport ' = > [ ' class ' = 'Swift_smtptransport ',//Use the class ' host ' = ' smtp.qq.com ',//email s
"; // The sdate and edate fields correspond to the two time ranges in the database respectively.
Mysql_query ("set names gb2312 ");
$ Result = mysql_query ($ SQL, $ db );
While ($ row = mysql_fetch_array ($ result ))
{
Printf ($ format, $ row [0], $ row [1], $ row [2], $ row [3], $ row [4], $ row [5]);
If ($ datesy = $ row [0] | datesy = $ row [1]) // currently, if the page is refreshed at a specified point, the program will only check the $ row [1], that is, the edate Time. only one emai
: This article mainly introduces a php email Library-swiftmailer. if you are interested in the PHP Tutorial, refer to it. Recently, I saw a good php mail library, which works the same as phpmailer, but has better performance than phpmailer. especially in terms of the ability to process attachments, the chances of sending emails are high. The following describes the usage:
1require_once ("lib/swift_required.php"); 2 3 // create a Transport object, set the email server and port number, and set t
Before doing a project to do a phpmailer to send mail with the function of "CI framework combined with phpmailer send mail", yesterday step on the line (just start with Sina cloud, too expensive, replaced by Ali), the test, send an email unexpectedly error ....
I wipe, not on-line time good, the second success, just started I thought is the SMTP address problem (I use 163 mailbox), later changed to QQ mailbox, found or no use, no way, had to ask degrees Niang, later looked at the answer on Bai
(1) The server cannot send mail using SMTP
Workaround: Many sites listed the solution is because of the SMTP case, although the nature of the problem is not here, but do need to change this place, as for why, look at the following operation.
In class.phpmailer.php, you will:
function Issmtp () {$this->mailer= ' SMTP ';}
Change to:
function Issmtp () {$this->mailer = ' SMTP ';}
Instead of using SMTP to send
understand:
mailer = $mailer; } /** * Purchase a podcast. * * @return void */ public function handle() { // }}
In this example, the PurchasePodcast job needs to send e-mails when a podcast is purchased. So, we willInjectA service that is able to send e-mails. since the service is injected, we are able to easily swap it out with another implementation. we are also a
php (as the current mainstream development language) for Windows, I use the latest php (as the current mainstream development language) 5, while downloading php (as the mainstream development language), you also need to download the zip package of the corresponding version on this website.
Download Mantis from http://www.mantisbt.org/download.php (as the mainstream development language today) and I am using version 0.19 (currently the latest ).
Download php from http: // php (as the mainstream
development language ). net/downloads. php (as the current mainstream development language) Download php (as the current mainstream development language) for Windows, I use the latest php (as the current mainstream development language) 5, while downloading php (as the mainstream development language), you also need to download the zip package of the corresponding version on this website.
Download Mantis from http://www.mantisbt.org/download.php (as the mainstream development language today) an
Recently using Phpmailer library to connect NetEase's smtp.126.com mail service send mail always return connection failed
Mailer Error: SMTP connect() failed.
The same is true for the Swiftmailer library.
This is the use of the new NetEase account will have problems, because the new NetEase account needs to open the client authorization code to use the SMTP service. The old account is not the problem.
How do I use this authorization code to connect
Send Error prompt:
SMTP error:could not connect to SMTP host. Mailer Error (9475@qq.com) SMTP error:could not connect to SMTP host.
Local tests are properly uploaded to the server.
When I put the function in the class
Public Function Issmtp ()
{
$this->mailer = ' smtp '; Change to $this->mailer = ' SMTP '; It can be sent but the message headers are duplicated and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.