우도비
swift mailer 본문
reference url : http://swiftmailer.org/
sample code
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.cafe24.com', 587, 'tls')
->setUsername('아이디')
->setPassword('비번');
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance();
$message->setSubject('Welcome')
->setFrom(array('sm.oh@visualrhyme.com'=>'오성민'))
->setTo(array('sm.oh@urbandigital.com'=>'welcome'))
->setBody('메일 내용', 'text/html');
// Pass a variable name to the send() method
if (!$mailer->send($message, $failures)) {
echo "Failures:";
print_r($failures);
} else {
echo "success";
}
Comments