PHPMailer Hotmail“¬”

时间:2013-03-29 12:14:30

标签: php email phpmailer hotmail

在PHP中,我使用PHPMailer 5.2.4发送电子邮件,我在Hotmail中遇到了一个非常奇怪的问题(在其他电子邮件阅读器中工作得很好)。

发送的电子邮件有一个链接,例如: http://www.noticenter.com.br/?modulo=noticias&caderno=geral&noticia=01343-avioes-fabricados-em-sc-participam-de-feira-nos-eua

在Outlook(和其他电子邮件阅读器)中,链接是正确的: http://www.noticenter.com.br/index.php?modulo=noticias&caderno=geral%c2%acicia=01343-avioes-fabricados-em-sc-participam-de-feira-nos-eua

但是在Hotmail中我得到“¬”代替“%c2%”http://www.noticenter.com.br/index.php?modulo=noticias&caderno=geral¬icia= 01343-avioes-FABRICADOS-EM-SC-participam-DE-德费拉-NOS-EUA

这是我用来发送电子邮件的代码:

    $content = 'Link: <a href="http://www.noticenter.com.br/?modulo=noticias&caderno=geral&noticia=01343-avioes-fabricados-em-sc-participam-de-feira-nos-eua">http://www.noticenter.com.br/?modulo=noticias&caderno=geral&noticia=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;
    }

1 个答案:

答案 0 :(得分:0)

从新的hotmail(outlook webmail)上的PHPMailer粗体链接访问:

http://www.noticenter.com.br/?modulo=noticias&caderno=propaganda-marketing%C2%一西西亚岛= 01334-propague-lanca-这份绿皮书-自我-OS-修斯-50-ANOS-DE-史记

当我在此链接上传递鼠标时显示: http://www.noticenter.com.br/?modulo=noticias&caderno=propaganda-marketing¬ ICIA = 01334-propague-lanca-这份绿皮书-自我-OS-修斯-50-ANOS-DE-史记

从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&noticia=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

Return-Path:name @ domain

收件人:姓名

从:=?UTF-8?Q?Noticenter _-_ A_sua_fonte_de_informa = C3 = A7 = C3 = A3o_e_neg = C3 = B3cio?=  =?UTF-8?Q?s_em_Santa_Catarina?=

回复:name @ domain

主题:=?UTF-8?B?VGVzdGUgTGluaw ==?= 消息ID:

X-Priority:3

X-Mailer:PHPMailer 5.2.4(http://code.google.com/a/apache-extras.org/p/phpmailer/

MIME-Version:1.0

内容类型:multipart / alternative;     边界= “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] =>