私はこのPHPスクリプトを持っていますが、経験はあまりありませんが、メールを提供しています。そのメールアドレスでメールを送信したいのですが、ウェブホストアカウントのメールアドレスを使用しています...何を変更する必要がありますか?
<?PHP
$ai_to = urldecode($_GET['to']);
$ai_from = urldecode($_GET['fr']);
$ai_su = urldecode($_GET['su']);
$ai_bo = str_replace("CRLF","\n", urldecode($_GET['bo']));
$ai_fname = urldecode($_GET['fi']);
$ai_fpath = $ai_fname;
$header = "From: " . 'aiapis mail svc:' . " <" . $ai_from . ">\r\n";
$header .= "Reply-To: " . $ai_from . "\r\n";
if ($ai_fname != '')
{
$data = file_get_contents('php://input');
if (file_put_contents($ai_fpath, $data) === FALSE) die("Upload failed, sen cancelled.");
$file_size = filesize($ai_fpath);
if ($file_size > 10485760) die("> 10MB. Send cancelled.");
$emtemp = 'emailtemp.log';
$current = file_get_contents($emtemp);
$current .= gmdate("Y-m-d\TH:i:s") . ", " . $ai_fname . ", " . round($file_size/1048576, 3) . "MB\n";
file_put_contents($emtemp, $current);
$handle = fopen($ai_fpath, "r");
$content = fread($handle, $file_size);
fclose($handle);
$content = chunk_split(base64_encode($content));
$uid = md5(uniqid(time()));
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n";
$header .= "This is a multi-part message in MIME format.\r\n";
$header .= "--".$uid."\r\n";
$header .= "Content-type:text/plain; charset=iso-8859-1\r\n";
$header .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$header .= $ai_bo."\r\n\r\n";
$header .= "--".$uid."\r\n";
$header .= "Content-Type: application/octet-stream; name=\"".$ai_fname."\"\r\n";
$header .= "Content-Transfer-Encoding: base64\r\n";
$header .= "Content-Disposition: attachment; filename=\"".$ai_fname."\"\r\n\r\n";
$header .= $content."\r\n\r\n";
$header .= "--".$uid."--";
$sent = mail($ai_to, $ai_su, "", $header);
}
else $sent = mail($ai_to, $ai_su, $ai_bo, $header);
if ($sent)
{
if ($ai_fname != '')
{
unlink($ai_fpath);
echo "Email+attachment sent.";
}
else echo "Email sent.";
}
else echo "Mail server rejected email.";
?>