在没有Outlook的Windows 7上设置MIME :: Lite [英] Set up MIME::Lite on Windows 7 without Outlook
问题描述
我在Windows 7机器上运行ActiveState的ActivePerl.我刚刚使用PPM(Perl软件包管理器)安装了MIME :: Lite模块.安装正常.
I run ActiveState's ActivePerl on my Windows 7 box. I just installed the MIME::Lite module using the PPM (Perl Package Manager). The installation went fine.
但是,当我尝试运行一个非常简单的脚本时
However, as I try to run a very simple script
use strict;
use MIME::Lite;
my $msg = MIME::Lite->new(
From => 'myname@host.com',
To => 'myname@host.com',
Subject => "Mail Test",
Data => "Test Test!!",
);
$msg->send;
我收到此错误:
SMTP Failed to connect to mail server: at C:\...\mail_test.pl line 10
这是否意味着我需要在Windows上安装第三方邮件服务器?还是可以配置脚本和/或窗口以使其在不进行新安装的情况下工作?特别是,我不在那台机器上运行Outlook.谢谢!
Does that mean I need to install a 3rd party mail server on my windows? Or can I configure the script and/or windows to make it work without new installation? In particular, I do not run outlook on that machine. Thx!
推荐答案
您需要给它提供主机以通过它发送邮件,否则它将尝试使用计算机上的SMTP服务器A)您不需要B)如果它是家用计算机很多人还是会拒绝它为垃圾邮件
You need to give it a host to send the mail through, otherwise its going to try and use the SMTP server on your computer which A) you don't have and B) if its a home computer many would reject it as spam anyway.
MIME :: Lite文档显示了如何
The MIME::Lite documentation shows how to tell it what SMTP host to use. Set it up with the same host, username and password as you would your normal mail client.
不幸的是,MIME :: Lite不支持加密,因此您的邮件将以不安全的方式发送出去.某些邮件服务器甚至不会再谈论未加密的邮件. Email :: Sender 我相信这是电子邮件中的人们建议您最近使用.
Unfortunately, MIME::Lite doesn't support encryption so your mail will be going out insecure and in the clear. Some mail servers won't even talk unencrypted any more. Email::Sender I believe is what the email folks recommend you use these days.
这篇关于在没有Outlook的Windows 7上设置MIME :: Lite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!