【发布时间】:2015-06-16 11:53:15
【问题描述】:
我是 PHP 新手,正在尝试使用 PHP 脚本发送电子邮件。
我确实将“php.ini”设置更改为
SMTP = "in.mailjet.com"
smtp_port= 25
auth_username="abc"
auth_password="abc"
sendmail_from = "abc@abc.com"
调用php文件的简单HTML文件是
form name="contactform" method="post" action="PHPMailer/email.php"
style="padding-left:5%;">
<td colspan="2" style="text-align:center"> <br>
<input class="btn btn-info" type="submit" value="Download">
email.php 文件
require 'class.phpmailer.php';
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->Host="in.mailjet.com";
$mail->SMTPAuth = true;
$mail->Username = 'abc';
$mail->Password = 'abc';
$mail->SetFrom('abc','Your Name');
$mail->AddAddress('jibran.ishtiaq@runyourfleet.com','Their Name');
$mail->Subject = 'Your email from PHPMailer and Mailjet';
$mail->MsgHTML('This is your email message.");
$mail->Send();
我正在尝试从 IIS 服务器(测试服务器)发送电子邮件,但我无法发送请帮助我或让我知道我缺少什么。
谢谢
【问题讨论】:
-
它可以是任意数量的东西,但 SO 语法高亮应该可以帮助您在倒数第二行中发现不匹配的引号
-
对不起,史蒂夫,你能帮我解决这个问题吗?
-
首先修复引用
...your email message.");应该是...your email message.');注意单引号,而不是双引号 -
这能回答你的问题吗? How to send email with SMTP in php
标签: php