PHPMailer How to send mails to anyone ?
I am a beginner to PHP and Web 2.0 development in general. I am making a project in which where once a user sign's up he/she will get a confirmation email in his/her inbox and must confirm the mail id by clicking on a link. Pretty standard stuff. Now I am using the latest version of PHPMailer to do this. I am connected to the gmail smtp, and the settings are as follows-:
Now when I am sending mails to a person who has a Gmail account it is working fine. But the moment I am sending any mail to someone with a Yahoo account, the mail doesn't seem to reach the client. Do I have to reconfigure PHPMailer again to say the yahoo SMTP service. Can I send mails to yahoo through the GMail SMTP ??? Or do i have to reconfigure again each time I have to send mail to a different service provider ?? Thank You.
$mail->Host = "smtp.gmail.com"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "tls"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "firstname.lastname@example.org"; // GMAIL username
$mail->Password = "foobar"; // GMAIL password