how to send Mail from localhost using PHP?
sending mail from localhost to remote server
i am using wamp server,OS windows Xp.
can anyone tell me about this issue
thank u in advance
how to send Mail from localhost using PHP?
sending mail from localhost to remote server
i am using wamp server,OS windows Xp.
can anyone tell me about this issue
thank u in advance
Got a gmail account? Yes? cool! As this will be the simplest solution for you. If not, you can use this library to connect to any other SMTP server. Let's use Gmail to send an email from our PHP script, here goes:
Download the SwiftMailer library from here: http://swiftmailer.org/download
# get the library
require_once 'Swift/lib/swift_required.php';
# setup the transport
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
->setUsername('yourusername@gmail.com')
->setPassword('yourpassword');
$mailer = Swift_Mailer::newInstance($transport);
# create our message
$message = Swift_Message::newInstance('Hello World!')
->setFrom(array('from@email.com' => 'Skynet'))
->setTo(array('to@email.com' => 'Terminator'))
->setBody('What would you like to say in the email?');
# send the message! hooray!
$mailer->send($message);