【问题标题】:Email::Send::SMTP::Gmail html tags not working电子邮件::发送::SMTP::Gmail html 标记不起作用
【发布时间】:2016-10-22 13:10:48
【问题描述】:
#!/usr/bin/perl
my $mail=Email::Send::SMTP::Gmail->new( -smtp=>'smtp.gmail.com',
                                            -login=>'sample@gmail.com',
                                            -pass=>'password');
my $body = '<h1>buddy I got it ...</h1>';
$mail->send(-to=>'to@gmail.com',-cc=>'',-subject=>'subject',
            -body=>$body,-contenttype=>'text/html');
$mail->bye;

Everytime i run my script here's the output

有人可以建议并帮助我解决为什么我的 html(正文电子邮件)不起作用。

【问题讨论】:

  • my $body ='&lt;h1&gt;buddy I got it . . . &lt;/h1&gt;';

标签: html perl email


【解决方案1】:

您将 HTML 代码放置在纯文本电子邮件的内容中。 此模块似乎不支持 HTML 电子邮件...如果您想在电子邮件中发送 HTML,则必须自己提供标头,或者找到为您完成此操作的模块。

关键:-contenttype=>'text/html'很可能被忽略了...模块文档中没有提到!

【讨论】:

    猜你喜欢
    • 2014-10-19
    • 2012-08-01
    • 2015-03-28
    • 2016-07-14
    • 1970-01-01
    • 2017-02-09
    • 1970-01-01
    • 2016-10-25
    • 1970-01-01
    相关资源
    最近更新 更多