0

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

发送的电子邮件有一个链接,例如: http ://www.noticenter.com.br/?modulo=noticias&caderno=geral¬icia=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-参与德费拉诺斯欧亚

但是在Hotmail中,我 在“%c2%”的位置得到了一个“¬”http: //www.noticenter.com.br/index.php? modulo=noticias&caderno=geral ¬icia=01343-avioes-fabricados- em-sc-participam-de-feira-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;
    }
4

1 回答 1

0

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

http://www.noticenter.com.br/?modulo=noticias&caderno=propaganda-marketing %c2%a cicia=01334-propague-lanca-livro-sobre-os-seus-50-anos-de-historia

当我通过此链接显示鼠标时: http ://www.noticias&caderno=propaganda-marketing ¬ icia=01334-propague-lanca-livro-sobre-os-seus-50-anos -de-historia

从 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

返回路径: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 优先级:3

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

MIME 版本:1.0

内容类型:多部分/替代;边界="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] => 

)

于 2013-03-30T01:00:14.907 回答