简体   繁体   English

使用perl脚本发送邮件时使用“发件人”地址?

[英]“From” address while using perl script to send a mail?

What I'm trying to understand here is what should we put in the from option in this Sendmail snippet. 我想在这里理解的是我们应该在此Sendmail片段的from选项中放入什么。 If I'm running the script from my local windows machine, what can i do to send the mail? 如果我从本地Windows计算机运行脚本,我该怎么做发送邮件?

use Mail::Sendmail;

sendmail(
From    => 'sender@somewhereelse.com',
To      => 'recipient@somewhere.com',
Subject => 'some subject',
Message => "body of the message",
);

Under the assumption that you're using SMTP to send mail, 假设您使用SMTP发送邮件,

unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'my.mail.server';

you can put in from field anything what would you put in Thunderbird/Outlook client. 您可以将任何您可以在Thunderbird / Outlook客户端中放入的内容from现场放入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM