How could I add SMTP Authentication into my email script?
Basically this email script gets sent using PHP Mail() but i am wanting it to get sent by using googlemail's smtp outgoing mail servers instead, i have read up on this and i know it is possible.
Some examples are below:
http://www.codewalkers.com/c/a/Email...-Email-Script/
http://support.webecs.com/KB/a390/ph...ntication.aspx
But i want to know how i could integrate it with the script i already have:
This email script that i already have is being automatically run every Friday by CRON.Code:<?php $to="ryan.fitton@googlemail.com"; $sub="Email From Website"; // set the default timezone to use. Available since PHP 5.1 date_default_timezone_set('Europe/London'); $Date = date("d M Y"); $Time = date("h:i A"); $msg .=" <html> <body> <p style='color:#000000;font-family:Helvetica,Arial,sans-serif;'> You have received an automated email. <br/><br/> This message was sent on the $Date at $Time <br/><br/> -------------------------------------- <br/> Message text goes here.... </p> </body> </html> "; $headers[] = 'MIME-Version: 1.0'; $headers[] = 'Content-type: text/html; charset=iso-8859-1' ; $headers[] = 'From:ryan.fitton@googlemail.com'; // the implode is because each line has to be separated by an return space (part of the RFC) $mail=mail($to,$sub,$msg, implode("\r\n", $headers)); if($mail) { echo "Mail successfully sent"; } else { echo "Sorry could not sent"; } ?>



Reply With Quote

Bookmarks