A thing I found hard to find was a specific example of how to set up PHPMailer to work with a GMail SMTP server. The results are actually quite simple and I managed to get it working with only a few tries. However if you are reading this you probably do not want to waste that 10 minutes, so I'll just show you the sample code below.
$pm = new PHPMailer();
$pm->IsSMTP(true);
$pm->Host = 'ssl://smtp.gmail.com:465';
$pm->SMTPAuth = true;
$pm->Username = 'yourusername@gmail.com';
$pm->Password = 'yourpassword';The above code shows all the configuration settings that need to be set. I will not reproduce the normal message attribute settings needed for sending mail in PHP with PHPMailer as you can find them at the PHPMailer website.
2 comments:
I run a large number of websites and wanted to have the PHPMailer available on my 'global webserver'. I've read that you can 'require' a script via a url. However, when I do this with PHPMailer it tells me the class doesnt exist?
Any ideas?
Hii..While executing the code,i get message as Mail has been sent but I am not able to receive any mail send through php mailer.
Post a Comment