• ベストアンサー

mailコマンドで上手くいかない

Marionetteの回答

回答No.6

> プロバイダのSMTPサーバを使って送信する場合は、fsockopen()関数を使います。 訂正: fsockopen()関数でSMTP接続してください。 > ; For Win32 only. > sendmail_from = ***@mail.goo.ne.jp Windows版はよく知らないけど、勝手にこんな指定をしてはまずいいんじゃないの? # このての質問はごろごろしてると思いますよ。検索してみては?

jyuu
質問者

補足

>Windows版はよく知らないけど、勝手にこんな指定をしてはまずいいんじゃないの? え?まずいんですか?? phpインストール時に連絡の取れるメールアドレスを聞かれて最初はHOTMAILに してたんですが、それもまずかったんでしょうか。 >検索してみては? 検索は自分なりにがんばってやっているのですがなかなかいいページにたどり着けないという状況です。。 多分情報処理能力が他の人より遅いのだと思います。 これでも以前に比べるとかなり早くなったのですが。

関連するQ&A

  • PHP の mail( ) 関数について

    お世話になります。 PHPのmail( )関数の使い方を練習しようと思い、以下に添付した簡単なスクリプトを試してみましたが、エラーが出ました。 スクリプト: <?php $address = 'my_address@yahoo.ca'; $subject = 'test mail'; $message = "Hello, I'm sending you an e-mail message.\r\n If you can read this. please let me know.\r\n"; $headers[] = "From: from@company.jp"; $headers[] = "Cc:sales@company.com"; $headers[] = "Content-type: text/html; charset=UTF-8"; $headers = implode("\r\n", $headers); $result = mail($address, $subject, $message, $headers, '-fmy_address@yahoo.ca'); if($result){ echo "message was sent<BR>"; } エラーメッセージ: Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\PHP-practice\email.php on line 9 ちなみに、エラーメッセージにある hp.ini の 関連個所は次のようになっています。 [mail function] ; For Win32 only. ; https://php.net/smtp SMTP=localhost ; https://php.net/smtp-port smtp_port=25 詳しい方がいらっしゃいましたら、自分のスクリプトの問題点と解決方法について、何かヒントでも頂けると有り難いです。 よろしくお願いいたします。

    • ベストアンサー
    • PHP
  • メールフォームから送信すると文字化けします^^;

    海外のHPのテンプレサイトにてダウンロードしたテンプレート内のメールフォームで送信すると文字化けしてしまいます^^; 下記がsendmail.php内の中身なのですが、何が足りないでしょうか?^^; ご教授よろしくお願いします。 http://www.premiumfreebies.eu/previews/ProFolio/ <? //This php file receives the post vars of the contact page and sends it to a email address //Settings $email = 'メールアドレス'; $subject = '[NAME] HP form mail '; $name = $_POST['name']; $from = $_POST['email']; $message = $_POST['message']; mb_language("ja"); mb_internal_encoding("UTF-8"); //Set the headers and send the mail $subject = str_replace('[NAME]', $name, $subject); $headers = 'From: '.$name.' <'.$from.'>'; mail($email, $subject, $message, $headers); ?>

    • ベストアンサー
    • PHP
  • メールが戻ってきます。

    アメリカのあるお店にメールを送りました。下記のようなメッセージで戻ってきます。 添付で自分の送った文章がついてきます。 どうしたら送ることができますか? 私はyahooを使っています。 Your message Subject: TO: Customer Service was not delivered to:******@mail.calltech.com because: Router: ******@yahoo.co.jp is restricted from sending mail through server SMTP/店名 どなたか分かりましたら教えて下さい。

  • PHPのmail関数で送信者を設定できません

    // 表題 $subject = $_POST['news_title']; // 本文 $message = ' <html> <head> <title>'.$_POST['news_title'].'</title> </head> <body> '.$_POST['textarea_id'].' </body> </html> '; // HTML メールを送信するには Content-type ヘッダが必須 $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n"; // 追加のヘッダ $headers .= 'To: '.$user_name.'<'.$email.'>'. "\r\n"; //$headers .= $_POST['news_title'] . "\r\n"; $headers .= 'From: 姓名 <myname@mymail.com>' . "\r\n"; // 送信する if(mail($to, $subject, $message, $headers)){$mes .= $email.'にメールを送信しました。 ';}else{$mes .= $email.'にメールを送信する際にエラーが発生しました。 ';} (後略) のようなコードになっていますが。$headersでFrom:を設定したのに、受信するメールには、送信者として、なになに@box450.bluehost.comが表示されます。どうやって正しく送信者を設定できるのでしょうか 因みにapacheのhttpd.confやPHPのphp.iniを変更できません。 わかる方がいらっしゃいましたら、ご回答をよろしくお願いします。

    • ベストアンサー
    • PHP
  • PCから携帯にメールすると

    PCから携帯にメールすると エラーになってしまいます。 その内容が読めないので、誰か 訳してくれませんか?? This Message was undeliverable due to the following reason: Your message was not delivered because the destination computer was not found. Carefully check that it was spelled correctly and try sending it again if there were any mistakes. It is also possible that a network problem caused this situation, so if you are sure the address is correct you might want to try to send it again. If the problem continues, contact your friendly system administrator. Host dokomo.ne.jp not found. The following recipients did not receive this message:

  • PHPとFALSH連携メール

    mail.fla と flash_mail.php に下記のように記述してます。 flash_mail.php で、var_dump() したら、すべてNULL になります。 .fla ファイルのシンタックスは通ってるのですが、 Action Scriptのどこかが間違っていると思います。 どこが間違っているのかお教え願いますでしょうか。 【mail.fla】 1フレーム目(キーフレーム)に書きを記述 LV1 = new LoadVars(); LV1.shimei = shimei; LV1.email = email; LV1.subject = subject; LV1.honbun = honbun; LV1.sendAndLoad("flash_mail.php", LV1, "POST"); submit_btn.onRelease = function(){ getURL("flash_mail.php"); } --------------------------------------------------------------------------- 【flash_mail.php】 <?php $shimei = $_POST['shimei']; $email = $_POST['email']; $subject = $_POST['subject']; $honbun = $_POST['honbun']; var_dump($shimei); var_dump($email); var_dump($subject); // 送信者へメール $to = $email; $from = "~"; $subject = mb_convert_encoding($subject, "utf-8", "auto"); // utf-8にエンコード $honbun = mb_convert_encoding($honbun, "utf-8", "auto"); mb_internal_encoding("UTF-8"); mb_send_mail($to, $subject, $honbun, $from); echo 'test complete!'; ?>

    • ベストアンサー
    • PHP
  • メールフォームの差出人を任意のアドレス表示に

    PHPでメールフォーム作ったのですが、差出人のアドレスを任意のものにしたいのです。 PHPは先月から始めた超初心者です。 いろいろな質問掲示板を参照にやっては見るのですが、出来ません。 //メール送信部分 mb_language("ja"); mb_internal_encoding("Shift-JIS"); $mailfr = "From:xxxx@oooo.oo"; $to = "aaa@dd.bn"; $subject = "タイトル"; $thanks = "コメント"; $headers = mb_convert_encoding($thanks, "SJIS","EUC-JP"); $message .= mb_convert_encoding($chuumonnaiyou, "SJIS","EUC-JP"); $message .= "\n\n"; $subject2 = "タイトル"; $thanks2 = "お礼メッセージ"; $headers2 = mb_convert_encoding($thanks2, "SJIS","EUC-JP"); $message .= "\n\n"; $message .= $copyright; mail($to, $subject, $message, $headers, $mailfr); ←上記に設定したメールアドレスに届く内容。 mail($email1, $subject2, $message, $headers2, $mailfr); ←フォームを利用して送ってくれた方への内容。 これも合っているのかわからないのですが、メールを送信も出来るし、受信も出来ています。 文字化けを起こしていたので、現在の型になりました。 (文字化けは、こちらの掲示板を利用して何とか解決しました。) もしかして、すごく簡単な質問なのかも知れませんが、調べては試しての繰り返しをしているのですがなかなか出来なくて困っています。 ぜひ、ご教授お願いします。

    • ベストアンサー
    • PHP
  • GOOメールがエラーになる。

    こんにちわ。 前にも質問したんですが、全然解決できなかったのでもう一度質問 させていただきました。 AさんがGOOメールを使って私のOutlookに送信すると 下記の英文エラーとなってAさんに返ってくるらしく、 私のOutlookに送信できないそうです。 これはどうしてでしょうか?すごい困ってます。 対処方法を教えてくださいm(__)m This Message was undeliverable due to the following reason: Your message was not delivered because the destination computer was not found. Carefully check that it was spelled correctly and try sending it again if there were any mistakes. It is also possible that a network problem caused this situation, so if you are sure the address is correct you might want to try to send it again. If the problem continues, contact your friendly system administrator.

  • HTMLメールを送信するには

    PHPからHTMLメールを送信する際の追加ヘッダーに書くべき内容について教えてください。 $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; multipart/alternative; charset=Shift_JIS\r\n"; mail($to, $subject, $message, $headers); として発信してますが 一部の受信側でTXTに化けてしまいます。 どなたか、HTMLメールの追加ヘッダーの書き方を教えていただきたいのですがよろしくお願いいたします。 5/11 usagi_024

    • 締切済み
    • PHP
  • PHPから携帯へメール送信

    いつもお世話になっております。 PHPから携帯電話へ"絵文字付き"でメールを送るプログラムを作成している のですが、『base64_encode』等を使用して絵文字の表示までは行う事がで きました。 ですが、本文が途中で途切れてしまうのです・・・。 PHP側は、 $to = mb_convert_encoding(mb_decode_mimeheader($structure->headers['from']), 'SJIS', 'ISO-2022-JP'); $subject = mb_convert_encoding(mb_decode_mimeheader($structure->headers['subject']), 'SJIS', 'ISO-2022-JP'); (省略)  ・  ・ $body = $structure->body; $body = preg_replace('/\s*>\s.*/', '', $body); $body = mb_convert_encoding($body, 'SJIS', 'ISO-2022-JP'); //---------------------------------- // base64_encode //---------------------------------- $subject = "=?shift_jis?B?" . base64_encode($subject) . "?="; $body = base64_encode($body); //---------------------------------- // ヘッダを作成 //---------------------------------- $headers = "From: test@mail.com\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: text/plain; charset=Shift-JIS\n"; $headers .= "Content-Transfer-Encoding: base64"; //---------------------------------- // メール送信 //---------------------------------- $res = mail($to, $subject, $body, $headers);  ・  ・ (省略) 上記のように記述しています。 メールは送れます。絵文字も表示されます。ですが、本文が途中で途切れ てしまいます。 どなたかご教授をお願い致します。

    • ベストアンサー
    • PHP