Details of php mail to configuration
- 2020-12-10 00:39:13
- OfStack
[mail function]
; For Win32 only.
SMTP = mail3.focuschina.com
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
With only the above code configured and no user name and password used, the test code successfully sent the email
Good reading, not very understand. The above
Test code sent:
<?php
[php] view plaincopyprint? in CODE View code slices derived from my code slices
$subject = iconv('UTF-8', 'GBK', " Email title ");
$message = iconv('UTF-8', 'GBK', " Send off your email fasdfadsfasdf");
$from ='OA<noreply@made-in-china.com>';
$from = iconv('UTF-8', 'GBK', $from);
$headers = "From: " . $from . "\nContent-Type: text/html; charset=GBK; MIME-Version: 1.0'\n";
$to="xuedagong@163.com";
if(mail($to, $subject, $message,$headers)){
echo "Ok.";
}else{
echo "Fail.";
}