e-mail with Phpmailer How to click the button to send a message

Source: Internet
Author: User
Now send an e-mail with Phpmailer, and the page refreshes and sends an email.
How to send an e-mail message by clicking a button on the page


Reply to discussion (solution)

You can do??? Face Ah.
For example, when a refresh is sent, the face is sendmail.php, press?? Face is send.php

send.php

   
 
          



Then join in the sendmail.php.

Write a form, add a submit, send a message after submission.

or set the button directly to refresh mode

Reply to the 1 floor
So, what's that Phpmailer page supposed to say?

Phpmailer, are you moving?
Header ("content-type:text/html; Charset=utf-8 ");
Require ("phpmailer/class.phpmailer.php"); Introducing Files
$mail = new Phpmailer (); Instantiation of
$mail->issmtp (); Enable SMTP
$mail->host= "smtp.126.com"; Name of the SMTP server
$mail->smtpauth = true; Enable SMTP authentication
$mail->username = "@126.com"; Your e-mail name
$mail->password = ""; Email password

$mail->from = "@126.com"; Sender address (i.e. your e-mail address)
$mail->fromname = ""; Sender's name
$mail->addaddress ("@126.com", "" "); Add recipients
$mail->addreplyto ("*****@126.com", "* * *"); Reply Address (can not fill in)

$mail->wordwrap = 50; Set character length per line
$mail->addattachment ("01.jpg", "manu.jpg"); Add an attachment and specify a name
$mail->ishtml (TRUE); Whether HTML-formatted messages

$mail->charset= "Utf-8"; Set up message encoding
$mail->subject = ""; Message subject
$mail->body = ""; Message content
$mail->altbody = "The body in plain text for non-html mail clients"; The message body does not support alternate display of HTML

if (! $mail->send ())
{
echo "Could not send mail.

";
echo "Mailer Error:". $mail->errorinfo;
Exit ();
} else {
echo "Mail has been sent";
}
?>

Now send an e-mail with Phpmailer, and the page refreshes and sends an email.



Reply to the 1 floor
So, what's that Phpmailer page supposed to say?



 ISSMTP ();      Enable SMTP $mail->host= "smtp.126.com";         The name of the SMTP server $mail->smtpauth = true;   Enable SMTP authentication $mail->username = "@126.com";      Your mailbox name $mail->password = "";            email password $mail->from = "@126.com";              The sender's address (that is, your email address) $mail->fromname = ""; Sender's name $mail->addaddress ("@126.com", "" ");    Add recipient//$mail->addreplyto ("*****@126.com", "* * *");                    Reply Address (can not fill in) $mail->wordwrap = 50;   Set the character length per line//$mail->addattachment ("01.jpg", "manu.jpg");                 Add an attachment and specify a name $mail->ishtml (TRUE);    Whether HTML-formatted mail $mail->charset= "Utf-8";          Set the message encoding $mail->subject = "";        Message subject $mail->body = ""; Message content $mail->altbody = "This is the body in plain text for non-html mail clients";  The message body does not support HTML for alternate display if (! $mail->send ()) {#echo "Cannot send mail.

"; #echo "Mailer Error:". $mail->errorinfo; #exit ();? >

Reply to the 6 floor
Now Phpmailer this PHP page
Page refresh after the prompt box, the message can arrive smoothly
But the Send page, the button has not worked, the message can not be sent
and the button above the word is garbled, not all is Utf-8 code, how still garbled

Thanks, the problem has basically been solved
Also very thankful for the version and 9925 Pro

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