314598340 发表于 2018-8-30 10:38:23

Perl 通过SMTP发送正文为HTML格式的邮件

use strict;  
use MIME::Lite;
  

  
my $mailhost="smtp.163.com";
  
my $username="test\@163.com";
  
my $password="test";
  
my $data='
  

  

  

  

  
title
  

  

  
hello world
  

  

  
';
  
my $msg=MIME::Lite->new(
  From=>"$username",
  To=>"$username",
  Subject=>"title",
  Type=>"text/html",
  Data=>"$data"
  
);
  
$msg->send('smtp',$mailhost,AuthUser=>$username,AuthPass=>$password);


页: [1]
查看完整版本: Perl 通过SMTP发送正文为HTML格式的邮件