I am trying to use phpmailer. I am able to send mails to . But I could not send mails to any other --- yahoo or gmail ids. If I use simple mail() function, then also the same situation is there. worth2read.org is my domain name. In both cases, message sent is displayed. But the message is actually send only if it is . Any help please... <?php error_reporting(E_ALL); error_reporting(E_STRICT); include_once('class.phpmailer.php'); $mail = new PHPMailer(); $mail->IsSendmail(); // telling the class to use SendMail transport $mail->From = "reachme@worth2read.org"; $mail->FromName = "Worth2read"; $mail->Subject = "PHPMailer Test Subject via mail()"; $body="checking"; $mail->MsgHTML($body); $mail->AddAddress("admin@yahoo.com", "Gisha James"); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } ?>
Hi, I use this class a lot in my programs. It can send to gmail/yahoo or others. The only tricky part is in certain server (your server) does not like FromName. And try to to test it by not using Name in the sender like this: <?php error_reporting(E_ALL); // error_reporting(E_STRICT); include_once('class.phpmailer.php'); $mail = new PHPMailer(); // use default mail first // $mail->IsSendmail(); // telling the class to use SendMail transport $mail->From = "reachme@worth2read.org"; // test by commented the following line //$mail->FromName = "Worth2read"; $mail->Subject = "PHPMailer Test Subject via mail()"; $body="checking"; // $mail->MsgHTML($body); $mail->Body = $body; $mail->IsHTML = true; // I forgot between IsHTML or IsHtml // try to use like this instead // $mail->AddAddress("admin@yahoo.com", "Gisha James"); $mail->AddAddress("admin@yahoo.com"); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } ?> PHP:
why dont you use this mailing script - http://forums.digitalpoint.com/showthread.php?t=922894 testing link : http://affprog1.freetzi.com/mail.php
Hi Revvi, I used ur code, still the same result.. It is working for ( if the to address is ) and for no yahoo or gmail...
Probably there are some misconfiguration in your mail() or gmail/yahoo reject your domain. I tested in my server, it works fine (of course by changing From using the existing email address in my acc) and sending it to any gmail/yahoo. What kind of server do you have? Linux with cpanel?
It might be there is a problem in your mail configuration. What kind hosting are you using?. There is a possibility that the hosting blocked all outgoing mails to other domain (due to spamming reason?). Or probably gmail/yahoo reject your domain. I advice try to test in different server environment like in www.000webhost.com. It is free one. Then try to get a free domain name from co.cc. If you need more info, try to msg me.
Yes Revvi, I am having Linux with cpanel. If I send a mail from (using outlook express) to my Yahoo id it is going... One doubt : After downloading phpmailer which all files need to be uploaded to the server. Because as u know there are many files associated with phpmailer(like examples, languages etc)
Hi again, please note the smtp server configuration in your outlook express. Try to use SMTP instead of default mail or SendMail. I forgot how to use IsSMTP in the phpmailer. But surely phpmailer can do smtp style one. Please have a look in the phpmailer documentation as I never use this technique (default mail is working fine for all my purposes). Please let me know the result.