php mail 發送郵件,該怎麼處理

來源:互聯網
上載者:User
php mail 發送郵件
我沒有學過php 今天下載了個網頁模板 有一個發送郵件的指令碼
PHP code
\n";$headers .= "Reply-To: $name <$mailFrom>\n";$message = $message_text;mail($mailTo, $subject, $message, $headers );?>


這樣簡簡單單的就能發送郵件嗎?不用設定smtp pop3之類的嗎 那發過去的話寄件者是誰呢?

------解決方案--------------------
你的電腦自身就是就是個帳號。
------解決方案--------------------
探討
你的電腦自身就是就是個帳號。

------解決方案--------------------
php.ini中有個[mail function]的配置選項。
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = [email protected]

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =

http://www.w3school.com.cn/php/php_ref_mail.asp
------解決方案--------------------
光有這個指令碼,是不能發郵件的。
手冊上:bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
郵件伺服器肯定得配置。只是你沒看見。
發信來自哪裡和郵件伺服器有關。
至於from 這個,自己可以隨便寫。
這也就是好多垃圾郵件的所在。
很多from 都是騙人的。
你可以自己試試哦~~~
------解決方案--------------------
當然要配置發件伺服器。 如果是linux/unix作業系統本身就帶發件功能。
------解決方案--------------------
WINDOWS系統,要配置SMTP服務。
------解決方案--------------------
探討
我沒有學過php 今天下載了個網頁模板 有一個發送郵件的指令碼
PHP code

// This is the script for sending email.


// change the email address below to your own email address.
$mailTo = [email protected]';


$name = htmlsp……
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.