Solved

Email from Perl with NT

Posted on 1998-12-03
3
127 Views
Last Modified: 2010-03-04
I want to send an email from a perl script using NT, how do I facilitate this?  I have access to an SMTP mailer (exchange) on my network.  

0
Comment
Question by:lweiner
  • 2
3 Comments
 

Author Comment

by:lweiner
Comment Utility
Adjusted points to 110
0
 
LVL 5

Accepted Solution

by:
b2pi earned 110 total points
Comment Utility

perldoc Net::SMTP  will show (after some intro)

use Net::SMTP;

$smtp = Net::SMTP->new('mailhost');
$smtp->mail($ENV{USER});
$smtp->to('postmaster');
$smtp->data();
$smtp->datasend("To: postmaster\n");
$smtp->datasend("\n");
$smtp->datasend("A simple test message\n");
$smtp->dataend();
$smtp->quit;

Additionally, you can take a look at higher level interfaces at

perldoc Mail::Mailer
perldoc Mail::Send


0
 
LVL 5

Expert Comment

by:b2pi
Comment Utility
You know, if I'd noticed you gave a B on this one, I would have let your other one ride.  For a proper, complete answer, one generally gives an A (how do you know? Take a look at the grading histories of any of the top 15)
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now