SMTP sends messages always error how to handle

Source: Internet
Author: User
What happens when SMTP sends a message always wrong?
I want to use SMTP to send mail activation account can always appear this problem I can't fix it.
------Solution--------------------
Did you send it successfully on your own test?

This looks pretty normal.

That's just not turning off the debug log, is it?

See if there's anything like log generation.

I use the Send mailbox is such a debugging
echo "Cause:". $this->smtp->logs;

You should have something like that, too.
------Solution--------------------
Reference:
reference: Did you send it successfully on your own test?

This looks pretty normal.

That's just not turning off the debug log, is it?

See if there's anything like log generation.

I use the Send mailbox is such a debugging
echo "Cause:". $this->smtp->logs;

You should have something like that, too.
The test did not send the success, can you say more understand? I still don't understand
.

This page is just a debug message I didn't see anything wrong to ask the master.
Here's what I got from somewhere else, my test is successful, it feels good, you can try
 $ip =$_server[' remote_addr '];
OK for the mailbox to send.
Include "smtp.class.php"; Send message classes that need to be included
$smtpserver = "smtp.163.com"; The address of your SMTP server
$smtpserver = ""; SMTP server address
$port = 25; The port of the SMTP server, typically 25
$smtpuser = ""; The user name of the SMTP server you are logged into
$smtppwd = ""; Your password to log on to the SMTP server
$mailtype = "HTML"; The type of message, the optional value is txt or HTML, TXT is a plain text message, HTML means a message in HTML format
$sender = "{$email}"; Sender Mailbox
sender, typically the same as the user name ($smtpuser) of the SMTP server you are logged on to, or it may fail to send because of the SMTP server's settings
$SMTP = new SMTP ($smtpserver, $port, False, $smtpuser, $smtppwd, $sender); When the third value is false, the message can be sent anonymously, $smtpuser, $smtppwd commented out
$smtp->debug = true; Whether to turn on debugging, only used when testing the program, when formally used, please do not comment out this line of comments will be a lot
$to = ""; Recipient mailbox
Ready-to-use mailboxes
$subject = "$time-($address)-$zixun 1"; Fill in the subject of the email here
$body = ""//the body content of the message is written here
$send = $smtp->sendmail ($to, $sender, $subject, $body, $mailtype); Send mail
?>

If an error is encountered, the method of debugging before this paragraph has an else or something that can be sent without a successful code
echo "Cause:". $this->smtp->logs; Logs sent by SMTP are generated
?>
  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.