名前とメールのあるemails.txtファイルがあります。例:John、[email protected] emails.txtとは別の方法でエクスポートしようとしています(例:name:john email :[email protected])受信者がテキストファイルphp mail
が、重要な部分は、私がメッセージexplode()への使用
$file = fopen("emails.txt", "r") or die("Unable to open file!");
//while(!feof($file)){
$line = fgets($file);
$to = $line;
$subject = "This is subject";
$message = 'Hello Mr %NAME%!';
$header = "From:TESTE \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";
$retval = mail ($to,$subject,$message,$header);
if($retval == true) {
echo "Message sent successfully...";
}else {
echo "Message could not be sent...";
}
fclose($file);
何が問題なのですか?どのようなエラーが表示されますか? – Synchro
名前とメールを分割する方法がわからず、自分のコードを使ってメールを送信する –
[email.txtとmessage.txtからカスタムメッセージを使ってPHPメールを送信する](http:// stackoverflow .com/questions/37925139/send-php-mail-using-emails-txt-and-custom-message-from-message-txt) – HPierce