Linuxmail sent an email statsent but did not receive an email. today, I tried to directly use the mail command (e. g: mail-s quot; hello quot; xxx@163.com) to send me 163.com mailbox, 163.com mailbox can not receive, but always can in/var /... linux mail sends an email stat = sent but does not receive an email. today, I try to use the mail command (e. g: mail-s "hello" xxx@163.com) to me 163.com mailbox, 163.com can not receive, however, you can always find the email I just sent under/var/mail
Mail Send configuration:Open the configuration file to add the following code to the components = [...] Medium (ex: Advanced version default configuration in/common/config/main-local.php) ' Mailer ' =>[ ' class ' => ' Yii\swiftmailer\mailer ', ' ViewPath ' => ' @common/mail ', ' Usefiletransport ' =>false, //this must be changed to False, otherwise the mail will not be sent ' Transport ' =>[ ' class '
process follows the process of dependency injection as stated above.Of course, if you specify that you want to bootstrap a component, such as the following. This will instantiate the log component when each request comes in.' Bootstrap ' = [ ' log ', ],), The following is an example of what is in components in the configuration.' Components ' = [ ' Request ' = [ //!!! Insert a secret key in the following (if it was empty)-this is required by
Yii2.0 internal has integrated the Swiftmailer Send mail class, no need to use Phpmailer class, I heard Swiftmailer this is also very powerful. Since the yii2.0 has been expanded inside, Then it will be implemented in its own way.Configure the relevant parameters of the message in web.php: ' Mailer ' = [ ' Class ' = ' Yii\swiftmailer\mailer ',//Introducing Swiftmailer Extensions' Transport ' =
This is the code: ActivationService. php {code ...} error message: {code ...} the position of the 53 lines is annotated in the code. the code is $ user- amp; gt; activatedtrue; problem: how can the above code solve this error? This is the code:
ActivationService. php
Mailer = $ mailer; $ this-> activationRepo = $ activationRepo;} public function sendActivationMail ($ user) {if ($ user-> activated |!
development language) object-oriented programming: the method for developing large php (as the mainstream development language) projects ). Most comments have been removed to facilitate reading. Some methods and class member variables are only used for internal processing and have been pointed out in the following annotations (also in the initial class file ).
Class MIME_mail {
// Public:
Var $;
Var $ from;
Var $ subject;
Var $ body;
Var $ headers = "";
Var $ errstr = "";
Var $ base64_func
to process sendmail processes to send emails. The following code is used as an example:
In fact, the method of this pipeline is relatively low, depending on the stability of the program you call. Therefore, it is an optional email sending method. 3. using phpmailer class is an open source mail class, the main site: http://phpmailer.sourceforge.net contains two files, one is class. smtp. php, but also a class. phpmailer. php also adds the official website usage: Examples using phpmailer 1. adva
Recently saw a good PHP mail library, like Phpmailer role, but performance than Phpmailer, especially in the ability to handle attachments, send mail success is also high. Here is a description of the usage:
1require_once("lib/swift_required.php");23//Create a Transport object, set the mail server and port number, and set the user name and password for authentication4$transport= Swift_smtptransport::newinstance (' smtp.163.com ', 25)5->setusername (' username@163.com ')6->setpassword (' Passwo
This article mainly introduces the phpmailer class call method for sending mails from a remote SMTP server, and analyzes the phpmailer Class Call and mail sending techniques in combination with the instance form, for more information about how to use the php mailer class to call a remote SMTP server to send emails, see the example below. We will share this with you for your reference. The details are as follows:
Php
= ' Smtppassword '; $mail->addaddress ("email@example.com");$mail->subject = "Test 1";$mail->body = "Test 1 of Phpmailer."; if (! $mail->send ()){echo "Error sending:". $mail->errorinfo;;}Else{echo "Letter is sent";}
/*
Add about sender Inforation, use the following features
The code is as follows
Copy Code
Mail->from= "mailer@example.com";$mail->fromname= "My Site ' s mail
We have introduced PHPMailer's usage and instance code. some friends found that when sending a Chinese email, the title and content are garbled characters. how can this problem be solved?
We have introduced PHPMailer's usage and instance code. some friends found that when sending a Chinese email, the title and content are garbled characters. how can this problem be solved?
Let's take a look at the previous example code mail. php file:
Require 'class. phpmailer. php ';
$ Mail = new PHPMailer;
$
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 there are two or more edates, no email will be
relatively low, depending on the stability of the program you call. Therefore, it is an optional email sending method.
3. Use the phpmailer class
Is an open source mail class, main site: http://phpmailer.sourceforge.net
There are two files, one is class. smtp. php, and the other is class. phpmailer. php.In addition, the use of the official website is as follows:Examples using phpmailer1. Advanced ExampleThis demonstrates sending out multiple email messages with binary attachments from a MySQL d
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.