& 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.