Use PHP to send email for account activation or password modification operations

Source: Internet
Author: User
Tags string format email account server port ssl connection

use Phpmailer to write a send message

Phpmailer need PHP Socket extension support, and Phpmailer link QQ domain name mailbox need SSL encryption Method (QQ mailbox has recently limited, new open domain mailbox no longer allow 25 port through the SMTP protocol of the normal link way link, Only allow SSL 465 or 587 ports [I have a domain mailbox open in the domain mailbox currently 25 port is still can link, may be security policy, limit the new open domain mailbox account 25 port]), solid PHP also have OpenSSL support, you can view Phpinfo

Preparatory work:

1. Phpmailer class file

2, there is an email account, here I use the QQ mailbox

"Note" Here is a point in particular to attract attention, must ensure that the mailbox Account SMTP/POP3 service is open, otherwise there is no way to connect to the mailbox server, more unlikely to send mail.

Specific view:

"Settings"-"Mailbox Settings"-"Account"-->pop3/imap/smtp/exchange/carddav/caldav service

When you do this, you often see an error:

1, Function set_magic_quotes_runtime () is deprecated?

PHP5.3 and PHP6.0 Remove the set_magic_quotes_runtime () function after the "problem Reason"

The "solution" is to replace the original Set_magic_quotes_runtime syntax with the Ini_set () method, for example:

2, Password command failed:535 error:authentication failed?

The "solution" will $mail->password the value of the configuration item to the authorization code of the SMTP server instead of the password for the SMTP server.

<?php
$user _name = "Li Wuming"; $content = <<

  

Use PHP to send email for account activation or password modification operations

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.