$objMail = new phpmailer();
$objMail->From = '[email protected]';
$objMail->FromName = 'myhost.com Admin';
$objMail->Subject = 'subject test phpmailer';
$objMail->Body = 'body test phpmailer';
$objMail->To[] = '[email protected]';
$objMail->SMTPAuth = true;
$objMail->Username = 'info@myhost';
$objMail->Password = 'xxxxx';
if ($objMail->Send()){
echo "send<br>";
}else{
echo "nosend<br>";
};
echo "<br>errors:";
print_r($objMail->ErrorInfo);
unset($objMail);
smpt سرور شما فعال هست ؟
نیاز نیست حتماً PHPMailer استفاده کنید !
mailer 0100<br>SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "220 mail.sgnetway.net
"
SMTP -> get_lines(): $data is "220 mail.sgnetway.net
"
SMTP -> FROM SERVER:
220 mail.sgnetway.net
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250 mail.sgnetway.net Hello [64.130.209.4]
"
SMTP -> get_lines(): $data is "250 mail.sgnetway.net Hello [64.130.209.4]
"
SMTP -> FROM SERVER:
250 mail.sgnetway.net Hello [64.130.209.4]
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "334 VXNlcm5hbWU
"
SMTP -> get_lines(): $data is "334 VXNlcm5hbWU
"
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ
"
SMTP -> get_lines(): $data is "334 UGFzc3dvcmQ
"
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "235 Authentication successful
"
SMTP -> get_lines(): $data is "235 Authentication successful
"
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250 OK <[email protected]> Sender ok
"
SMTP -> get_lines(): $data is "250 OK <[email protected]> Sender ok
"
SMTP -> FROM SERVER:
250 OK <[email protected]> Sender ok
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]}
"
SMTP -> get_lines(): $data is "501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]}
"
SMTP -> FROM SERVER:
501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]}
SMTP -> ERROR: RCPT not accepted from server: 501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]}