If you have sent an email, please contact us! First: $ to & quot; luoing_2@163.com & quot; $ subject & quot; Testmail & quot; $ message & quot; Hello! Thisisasimpleemailmessage. & quot; $ from & quot; luoin_2@126.com & email problems, have done please!
First:
$ To = "luoing_2@163.com ";
$ Subject = "Test mail ";
$ Message = "Hello! This is a simple email message .";
$ From = "luoin_2@126.com ";
$ Headers = "From: $ from ";
Mail ($ to, $ subject, $ message, $ headers );
Echo "Mail Sent .";
==========================================
Second
Require 'class. phpmailer. php ';
Try {
$ Mail = new PHPMailer (true); // New instance, with exceptions enabled
$ Body = file_get_contents('contents.html ');
$ Body = preg_replace ('// \\\/', '', $ body); // Strip backslashes
$ Mail-> IsSMTP (); // tell the class to use SMTP
$ Mail-> SMTPAuth = true; // enable SMTP authentication
$ Mail-> Port = 25; // set the SMTP server port
$ Mail-> Host = "smtp.126.com"; // SMTP server
$ Mail-> Username = "luoin_2@126.com"; // SMTP server username
$ Mail-> Password = "luo11111"; // SMTP server password
$ Mail-> IsSendmail (); // tell the class to use Sendmail
$ Mail-> AddReplyTo ("name@domain.com", "First Last ");
$ Mail-> From = "luoin_2@126.com ";
$ Mail-> FromName = "Biyi Network ";
$ To = "wang_lin_1@163.com ";
$ Mail-> AddAddress ($ );
$ Mail-> Subject = "First PHPMailer Message ";
$ Mail-> AltBody = "To view the message, please use an HTML compatible email viewer! "; // Optional, comment out and test
$ Mail-> WordWrap = 80; // set word wrap
$ Mail-> MsgHTML ($ body );
$ Mail-> IsHTML (true); // send as HTML
If (! $ Mail-> Send ())
{
Echo "Message cocould not be sent.
";
Echo "Mailer Error:". $ mail-> ErrorInfo;
Exit ();
} Else {
Echo "Message has been sent ";
}
} Catch (phpmailerException $ e ){
Echo $ e-> errorMessage ();
}
After sendmail is started, what emails are sent in spam?
========================================================== ==================================
------ Solution --------------------
After sendmail is successful, you must use the receiving program to receive it. qmail is on my machine, and you do not know it.
------ Solution --------------------
After sendmail is started, what emails are sent in spam?
It may be because the email receiving mailbox has Related filtering settings.
It may be defined by the user, or the mailbox is defined by default.
. The result is: when a type of mail or a user's mail
After the email is sent to the target email address, the target email address automatically identifies it as spam,
And delete it or put it in the recycle bin.
Spam,
------ Solution --------------------
First, it is certainly not good. your own sendmail as an smtp server will not be trusted by other email servers. using 126 for smtp is certainly not easy to be considered as spam.
------ Solution --------------------
$ Mail-> IsSendmail (); // tell the class to use Sendmail
Remove this sentence.
------ Solution --------------------
Spam cannot be controlled
------ Solution --------------------
Change IP address