Email sending code-php email sending code

Source: Internet
Author: User

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> -- invite friends </title>
<Style type = "text/css">
<! --
Body {
Margin: 0px;
Padding: 0px;
Font-size: 12px;
Background-color: # CFCFCF;
}
Input {
Line-height: 18px;
Height: 18px;
Border: 1px solid # CCCCCC;
}
Img {
Border-top-width: 0px;
Border-right-width: 0px;
Border-bottom-width: 0px;
Border-left-width: 0px;
}
*{
Margin: 0px;
Padding: 0px;
List-style-image: none;
List-style-type: none;
Background-repeat: no-repeat;
}
Td {
Line-height: 22px;
Font-size: 14px;
Font-weight: 700;
Color: #276662;
}
-->
</Style>
</Head>

<Body>

<Form action = "#" method = "post" name = "form">
<Table border = "0" align = "center" cellpadding = "0" cellspacing = "0">
<Tr>
<Td width = "572" height = "227" valign = "top" background = "img/mailfooterimg.gif"> <table width = "95%" border = "0" align =" center "cellpadding =" 0 "cellspacing =" 0 ">
<Tr>
<Td height = "70"> & nbsp; </td>
</Tr>
<Tr>
<Td> <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0">
<Tr>
<Td> <input type = "text" value = "http://111cn.net/" size = "60"/> </td>
<Td height = "40"> <a href = "#"> </> </td>
</Tr>
</Table> </td>
</Tr>
<Tr>
<Td height = "28"> friend name:
<Input type = "text" size = "22"/>
& Nbsp;
Email address:
<Input type = "text" size = "22"/> </td>
</Tr>
<Tr>
<Td height = "28"> friend name:
<Input type = "text" size = "22"/>
& Nbsp;
Email address:
<Input type = "text" size = "22"/> </td>
</Tr>
<Tr>
<Td height = "28"> friend name:
<Input type = "text" size = "22"/>
& Nbsp;
Email address:
<Input type = "text" size = "22"/> </td>
</Tr>
<Tr>
<Td height = "28" align = "right"> <a href = "#"> </a> </td>
</Tr>
</Table> </td>
</Tr>
</Table>
</Form>
</Body>
</Html>
Email sending function page.

Mail. php

<?

Require (dirname (_ FILE _). "/mail/class. phpmailer. php"); // call the phpmailer type. If phpmailer is not available, click here to downloadPhpmailerFor php5/6 Download

$ Array = array_unique (Get_value ('mail', 1); // remove duplicate email addresses

$ Mail = new PHPMailer ();
$ Count = 0;
$ Bad = 0;
$ Mail-> IsSMTP (); // set mailer to use SMTP
$ Mail-> Host = "smtp.163.com"; // smtp1.example.com; smtp2.example. comspecify main and backup server
$ Mail-> SMTPAuth = true; // turn on SMTP authentication
$ Mail-> Username = "mailangel123"; // SMTP username
$ Mail-> Password = "*******"; // SMTP password
 
$ Mail-> From = "mailangel123@163.com ";
$ Mail-> FromName = "from your friends ";
$ MailBody = 'content'

$ Mail-> AddReplyTo ("mailangel123@163.com", "Australia ");
$ Mail-> AddAddress ($ tmpmail, 'Hello! ');
$ Mail-> WordWrap = 50;
$ Mail-> CharSet = "GB2312 ";
// $ Mail-> AddAttachment ("/var/tmp/file.tar.gz ");
// $ Mail-> AddAttachment ("/tmp/image.jpg", "new.jpg ");
$ Mail-> IsHTML (true );
   
$ Mail-> Subject = "your friends invite you to take a photo! ";
$ Mail-> Body = $ MailBody;
   
If (! $ Mail-> Send ())
   {
$ Bad ++;
$ Mail-> ClearAddresses ();
$ Mail-> ClearAttachments ();
     
   }

OK.

?>

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.