-
-
require("phpmailer/class.phpmailer.php");
- function smtp_mail( $sendto_email, $subject, $body, $extra_hdrs, $user_name){
- $mail = new PHPMailer();
- $mail->IsSMTP(); // send via SMTP
- $mail->Host = "200.162.244.66"; // SMTP servers
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->Username = "yourmail"; // SMTP username 注意:普通邮件认证不需要加 @域名
- $mail->Password = "mailPassword"; // SMTP password
- $mail->From = "yourmail@yourdomain.com"; // 发件人邮箱
- $mail->FromName = "管理员"; // 发件人
-
- $mail->CharSet = "GB2312"; // 这里指定字符集!
- $mail->Encoding = "base64";
- $mail->AddAddress($sendto_email,"username"); // 收件人邮箱和姓名
- $mail->AddReplyTo("yourmail@yourdomain.com","yourdomain.com");
- //$mail->WordWrap = 50; // set word wrap 换行字数
- //$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment 附件
- //$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
- $mail->IsHTML(true); // send as HTML
- // 邮件主题
- $mail->Subject = $subject;
- // 邮件内容
- $mail->Body = "
-
-
-
-
-
- I love php
|
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
作者最新文章
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31