<Beginner's Post> could you tell me how to send an email to the user who stores the form data into the database?

Source: Internet
Author: User
& Lt; newbie Post & gt; how can I send an email to the user who stores the form data in the database?
 IsSMTP (); // use SMTP to send $ mail-> CharSet = 'utf-8'; // set the character encoding of the email $ mail-> Host = "mail. xxxxx. * ** "; // your enterprise Post Office domain name $ mail-> SMTPAuth = true; // enable the SMTP verification function $ mail-> Port = "***"; // SMTP Port $ mail-> Username = *** @ xxxx. * **; // Post Office user name (enter the complete email address) $ mail-> Password = "******"; // Post Office password $ mail-> From = *** @ xxxx. * **; // email address of the email sender $ mail-> FromName = "Your Name"; $ mail-> AddAddress ("$ address ",""); // recipient address, which can be replaced with any email address to receive the email. the format is AddAddress. ("Recipient email", "recipient name") // $ mail-> AddReplyTo ("",""); // $ mail-> AddAttachment ("/var/tmp/file.tar.gz"); // add attachments // $ mail-> IsHTML (true ); // set email format to HTML // whether to use the HTML format $ mail-> Subject = "PHPMailer test mail"; // mail Title $ mail-> Body = "Hello, this is the test email "; // the email content $ mail-> AltBody =" This is the body in plain text for non-HTML mail clients "; // additional information, if (! $ Mail-> Send () {echo "failed to Send the email.

"; Echo" error cause: ". $ mail-> ErrorInfo; exit;} echo" email sent successfully ";?>




Can I set this code ~ Thank you very much.


Reply to discussion (solution)

Reference: http://blog.csdn.net/fdipzone/article/details/8683993

How can I set the email content to the database and send it to him?-thank you.

Read the database content and place it in $ mail-> Body = 'Here fill in the data read from the database'

Is it to write the code from the database data to the email address of the recipient after the body? =-how to set
Thank you.

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.