返回顶部

收藏

php通过joomla jmail 类使用 gmail smtp 账号发送邮件

更多
<?php
jimport('joomla.mail.mail');
$mail = new JMail();
$mail->setsender("useremail");
$mail->addRecipient("destination@email.com");
$mail->setSubject("Here goes the subject");
$mail->setbody("The body of mail");
$mail->addAttachment('c:\\1.pdf');
$mail->useSMTP(true, "smtp.gmail.com", "useremail", "password",'ssl',465);
$mail->send();
?>

标签:php邮件,gmail,smtp

收藏

0人收藏

支持

0

反对

0