sendmail2.php
资源名称:sendmail2.rar [点击查看]
上传用户:gdxydsw
上传日期:2020-07-21
资源大小:1k
文件大小:1k
源码类别:
WEB邮件程序
开发平台:
PHP
- <?php
- function sendMail($to, $subject, $body, $from_email) {
- $headers = "MIME-Version: 1.0 n" ;
- $headers .= "From: " .
- ""."<".$from_email."> n";
- $headers .= "Reply-To: " .
- ""."<".$from_email."> n";
- $headers .= "Content-Type: text/plain;charset=ISO-2022-JP n";
- $body = mb_convert_encoding($body, "ISO-2022-JP","shift-jis");
- $sendmail_params = "-f$from_email";
- mb_language("ja");
- $subject = mb_convert_encoding($subject, "ISO-2022-JP","AUTO");
- $subject = mb_encode_mimeheader($subject);
- $result = mail($to, $subject, $body, $headers, $sendmail_params);
- return $result;
- }
- $to = "yourmail@yahoo.co.jp";
- $subject = "偍栤偄崌傢偣偑偁傝傑偟偨丅";
- $body = "柤慜n".$_POST['textfield']."nn儊乕儖傾僪儗僗n".$_POST['textfield2']."nn擭楊n".$_POST['radio']."nn惈暿n".$_POST['textfield3']."nn偍栤偄崌傢偣撪梕n".$_POST['textfield4'];
- $from_email = $_POST['textfield2'];
- sendMail($to, $subject, $body, $from_email);
- header("Location: index.html");
- ?>