我正在使用 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@localhost
我知道我可以在 class.phpmailer.php 文件中更改它,但我希望能够在上面的代码中设置它
这可能吗?