我正在使用PHP Mailer发送邮件,同时使用SMTP。
以下是我使用的代码:
以下是我使用的代码:
$email = new PHPMailer();
$email->IsSMTP(); // telling the class to use SMTP
$email->Host = "mail.integradigital.co.uk"; // SMTP server
$email->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$email->SMTPAuth = true; // enable SMTP authentication
$email->Host = "mail.integradigital.co.uk"; // sets the SMTP server
$email->Port = 26; // set the SMTP port for the GMAIL server
$email->Username = "sending@************.co.uk"; // SMTP account username
$email->Password = "********"; // SMTP account password
$email->SetFrom($result["emailfrom"]);
$email->FromName($result["emailfrom"]);
$email->Subject = $result["subject"];
$email->Body = $result["message"];
但是它发送和显示为Root User - root@localhost
我知道我可以在class.phpmailer.php文件中更改这个,但我想能够在上面的代码中设置它。
这有可能吗?
$result["emailfrom"]
已经设置了值吗? - tlenss