What if smtp always fails to send emails? I want to use smtp to send an email to activate the account & nbsp; but I can't solve this problem all the time. ------ solution ------------------ did you successfully send the email during your test? This looks quite normal. isn't the debugging log closed? Check if there is any log or the like. the sending mailbox I use is such a debugging echo & nbsp; cause:. $ this-& smtp always fails to send emails. what should I do?
I want to use smtp to send an email to activate the account. this problem persists.
------ Solution --------------------
Did you send the message successfully during your test?
This looks quite normal.
This is just not turning off the debugging log, right?
Check whether or not a log is generated.
I used the sending mailbox for such debugging.
Echo "cause:". $ this-> smtp-> logs;
You should have something similar.
------ Solution --------------------
Reference:
Reference: Did you send the message successfully during your test?
This looks quite normal.
This is just not turning off the debugging log, right?
Check whether or not a log is generated.
I used the sending mailbox for such debugging.
Echo "cause:". $ this-> smtp-> logs;
You should have something similar.
If the test fails, can you make it clear? I still don't know much about it.
This page is just debugging information. I didn't see any errors. Ask the experts.
The following is what I got from other places. my test is successful. it feels good to use it. you can try it.
$ Ip = $ _ SERVER ['remote _ ADDR '];
// Send an OK email.
Include "smtp. class. php"; // The Mail class to be included
// $ Smtpserver = "SMTP.163.com"; // address of your smtp server
$ Smtpserver = ""; // smtp server address
$ Port = 25; // The smtp server port, usually 25
// $ Smtpuser = ""; // user name of the smtp server you log on
// $ Smtppwd = ""; // password of your smtp server
$ Mailtype = "HTML"; // mail type. optional values: TXT or HTML. TXT indicates a plain text email. HTML indicates an html email.
$ Sender = "{$ email}"; // sender's email
// Sender, which is generally the same as the username ($ smtpuser) for logging on to the smtp server. otherwise, sending may fail due to the setting of the smtp server.
$ Smtp = new smtp ($ smtpserver, $ port, false, $ smtpuser, $ smtppwd, $ sender); // if the third value is false, you can log on anonymously to send emails, comment out $ smtpuser and $ smtppwd
// $ Smtp-> debug = true; // whether to enable debugging. it is only used for testing the program. Note this line without comments during official use.
$ To = ""; // recipient's email
// Prepared email address
$ Subject = "$ time-($ address)-$ zixun1"; // enter the subject of the email here.
$ Body = "" // The body of the email written here
$ Send = $ smtp-> sendmail ($ to, $ sender, $ subject, $ body, $ mailtype); // send an email
?>
// If an error occurs, debug the method. This section contains an else or something that can be used to send unsuccessful code.
Echo "cause:". $ this-> smtp-> logs; // logs sent by smtp are generated.
?>