phpmailer例行帮助 [英] phpmailer routine help
本文介绍了phpmailer例行帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从我的网站通过php邮寄一些数据的功能,所以我正在尝试一个示例来了解如何操作.但它不起作用.因为它需要身份验证,所以我正在使用phpmailer,但是它不起作用.
这是代码.
I need the function to mail some data through php from my website, so i am trying an example to know how. but it is not working. as it needs authentication i am using phpmailer, but it is not working.
this is the code.
<?require("path\phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.example.com";
$mail->SMTPAuth = true;
$mail->Username = "usernamexxx";
$mail->Password = "password";
$mail->From = "xxxxxx@example.com";
$mail->FromName = "Name";
$mail->AddReplyTo("name@example.com");$mail->AddAddress("name@example.com");
$mail->IsHTML(true);$mail->Subject = "Test message sent using the PHPMailer component";
$mail->Body = "This is a test message.";$mail->Send();
?>
这是错误:
this is the error:
Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\test.php on line 3
请帮忙
[edit]紧急情况已删除-OriginalGriff [/edit]
Please help
[edit]Urgency deleted - OriginalGriff[/edit]
推荐答案
mail = new PHPMailer();
mail = new PHPMailer();
mail- > IsSMTP();
mail->IsSMTP();
mail-> Host ="smtp.example.com";
mail->Host = "smtp.example.com";
这篇关于phpmailer例行帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文