在PHP中,我使用PHPMailer 5.2.4发送电子邮件,我在Hotmail中遇到了一个非常奇怪的问题(在其他电子邮件阅读器中工作完美)。
发送的邮件有一个链接,例如:http://www.noticenter.com.br/?modulo=noticias& caderno = geral& noticia = 01343 -株式会社fabricados - em - sc - participam - de - feira nos -欧洲大学协会
在Outlook(和其他电子邮件阅读器)中的链接是正确的:http://www.noticenter.com.br/index.php?modulo=noticias& caderno =; % c2%acicia = 01343 -株式会社fabricados - em - sc - participam - de - feira nos -欧洲大学协会
但是在Hotmail中,我得到一个"¬"在"%c2%"的地方:http://www.noticenter.com.br/index.php?modulo=noticias& caderno =;¬icia = 01343 -株式会社fabricados - em - sc - participam - de - feira nos -欧洲大学协会
这是我用来发送电子邮件的代码:
$content = 'Link: <a href="http://www.noticenter.com.br/?modulo=noticias&caderno=geral¬icia=01343-avioes-fabricados-em-sc-participam-de-feira-nos-eua">http://www.noticenter.com.br/?modulo=noticias&caderno=geral¬icia=01343-avioes-fabricados-em-sc-participam-de-feira-nos-eua</a>';
$mail = new phpmailer();
$mail->SMTPDebug = 0;
$mail->Host = emailServerNews_Host;
$mail->Mailer = emailServerNews_Mailer;
$mail->SMTPAuth = emailServerNews_Authentication;
$mail->Username = emailServerNews_Username;
$mail->Password = emailServerNews_Password;
$mail->Port = emailServerNews_Port;
$mail->From = 'email@domain';
$mail->FromName = utf8_encode($title);
$mail->Body = utf8_encode($content);
$mail->AltBody = "HTML";
$mail->Subject = '=?UTF-8?B?'.base64_encode($subject).'?=';
$mail->AddReplyTo('email@domain');
$mail->CharSet = "UTF-8";
$mail->AddAddress($email, utf8_encode($name));
if($mail->Send() == true){
$ErrorInfo = $mail->ErrorInfo;
return true;
}else{
$ErrorInfo = $mail->ErrorInfo;
return false;
}
从PHPMailer到新hotmail (outlook webmail)的粗体链接:
http://www.noticenter.com.br/?modulo=noticias& caderno = propaganda-marketing % c2%a cicia = 01334 - propague lanca livro -尤其-操作系统- seu - 50岁- de -史学家
当我把鼠标放在这个链接上时:http://www.noticenter.com.br/?modulo=noticias& caderno = propaganda-marketing ¬ icia = 01334 - propague lanca livro -尤其-操作系统- seu - 50岁- de -史学家
Debug from PHPMailer():
PHPMailer对象(
[Priority] => 3
[CharSet] => UTF-8
enter code here
[ContentType] => multipart/alternative
[Encoding] => 8bit
[ErrorInfo] =>
[From] => name@domain
[FromName] => Noticenter - A sua fonte de informação e negócios em Santa Catarina
[Sender] =>
[ReturnPath] =>
[Subject] => =?UTF-8?B?VGVzdGUgTGluaw==?=
[Body] => Link: <a href="http://www.noticenter.com.br/?modulo=noticias&caderno=propaganda-marketing¬icia=01334-propague-lanca-livro-sobre-os-seus-50-anos-de-historia" style="color:#545454!important;text-decoration:none"><font face="Trebuchet MS" size="4" color="#545454" style="line-height: 22px; font-size: 20px;">Propague lança livro sobre os seus 50 anos de história</font></a><br>
[MIMEHeader:protected] => Date: Fri, 29 Mar 2013 18:23:03 -0300
网络:name@domain
To: name
来自:= utf - 8 ?问? Noticenter_ -_A_sua_fonte_de_informa = C3 = A7 = C3 = A3o_e_neg = C3 = B3cio吗?=utf - 8 = ?问s_em_Santa_Catarina ?=
应答:name@domain
主题:= utf - 8 ? B ? VGVzdGUgTGluaw = = ?=问题:
X-Priority: 3
X-Mailer: phpmmailer 5.2.4 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
MIME-Version: 1.0
- type: multipart/替代;边界= " b1_ee5bcdb787b4b63212cee74d72b2c699 "
[mailHeader:protected] =>
[WordWrap] => 0
[Mailer] => smtp
[Sendmail] => /usr/sbin/sendmail
[UseSendmailOptions] => 1
[PluginDir] =>
[ConfirmReadingTo] =>
[Hostname] =>
[MessageID] =>
[MessageDate] =>
[Host] => localhost
[Port] => 25
[Helo] =>
[SMTPSecure] =>
[SMTPAuth] =>
[Username] =>
[Password] =>
[AuthType] =>
[Realm] =>
[Workstation] =>
[Timeout] => 10
[SMTPDebug] => 1
[Debugoutput] => echo
[SMTPKeepAlive] =>
[SingleTo] =>
[SingleToArray] => Array
(
)
[LE] =>
[DKIM_selector] =>
[DKIM_identity] =>
[DKIM_passphrase] =>
[DKIM_domain] =>
[DKIM_private] =>
[action_function] =>
[Version] => 5.2.4
[XMailer] =>
[smtp:protected] => SMTP Object
(
[SMTP_PORT] => 25
[CRLF] =>
[do_debug] => 1
[Debugoutput] => echo
[do_verp] =>
[Timeout] => 10
[Timelimit] => 30
[Version] => 5.2.4
[smtp_conn:SMTP:private] => 0
[error:SMTP:private] =>
[helo_rply:SMTP:private] =>
)
[to:protected] => Array
(
[0] => Array
(
[0] => name@domain
[1] => name
)
)
[cc:protected] => Array
(
)
[bcc:protected] => Array
(
)
[ReplyTo:protected] => Array
(
[name@domain] => Array
(
[0] => name@domain
[1] =>
)
)
[all_recipients:protected] => Array
(
[name@domain] => 1
)
[attachment:protected] => Array
(
)
[CustomHeader:protected] => Array
(
)
[message_type:protected] => alt
[boundary:protected] => Array
(
[1] => b1_ee5bcdb787b4b63212cee74d72b2c699
[2] => b2_ee5bcdb787b4b63212cee74d72b2c699
[3] => b3_ee5bcdb787b4b63212cee74d72b2c699
)
[language:protected] => Array
(
)
[error_count:protected] => 0
[sign_cert_file:protected] =>
[sign_key_file:protected] =>
[sign_key_pass:protected] =>
[exceptions:protected] =>
)