Phpmailer e-Mail related issues, the server is not connected

Source: Internet
Author: User
Phpmailer email problem, server connection not on
e-mail with Phpmailer, there are two errors ...

1.
When you bring your own code with the Phpmailer document, use the gmail,sohu,126 ... to not connect to the server

But later with QQ mailbox, can connect, also can send mail, but not stable, sometimes send failed ... Then it is estimated that the problem of the service provider ....

2. Mail sent by QQ mailbox, local 100% easy to use, uploaded to the server is not good

Tip error is SMTP error:could not connect to SMTP host.

I thought it was a php.ini problem, just looked at ...

Sendmail_from No value No value
Sendmail_path No value No value
SMTP localhost localhost
Smtp_port 25 25

The server and the local configuration is the same, why it is not good to use .... It's a very embarrassing and embarrassing.

The following code has been tested locally, can be sent, the server does not
PHP Code
  Phpmailer class Require_once ("./plugin/phpmailer/class.phpmailer.php"); Require_once ("./plugin/phpmailer/        Class.smtp.php "),//Functionfunction sendmailtoclient ($client) {$mail = new Phpmailer ();    $mail->issmtp ();         $mail->smtpauth = true;        Set to secure authentication method $mail->host = "smtp.qq.com";      SMTP server address $mail->username = "[email protected]";               Login user name $mail->password = "PSW";        Login password $mail->from = "[email protected]";        Sender address ([email protected]) $mail->fromname = "sender name";    $mail->wordwrap = 50;            $mail->ishtml (TRUE);        Whether HTML mail is supported, true or false $mail->addaddress ("$client");    Customer email address $mail->subject = "title";    $mail->body = "text content"; if (! $mail->send ()) {echo ' Message could not ' be sent.

"; echo "Mailer Error:". $mail->errorinfo; return FALSE; } return TRUE; Method call $client = "[email protected]"; Sendmailtoclient ($client);



------Solution--------------------
is the firewall not allowing you to access smtp.qq.com?
------Solution--------------------
The top bar must be a server problem.
The server and the local configuration are the same as this little suspicion
There must be a different set of places.
------Solution--------------------
Phpmailer Remember there is a debug option, the landlord set this to true to see if there are shrimp tips O (∩_∩) o~

Sloppy gather search professional paper search engine
------Solution--------------------
SMTP server with localhost? server-side configuration it should be different from the local one.
You can debug it upstairs.
Top Up
  • Related Article

    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.