Solved

Email from Perl with NT

Posted on 1998-12-03
3
136 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:lweiner
ID: 1206710
Adjusted points to 110
0
 
LVL 5

Accepted Solution

by:
b2pi earned 110 total points
ID: 1206711

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
ID: 1206712
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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Perl script to parse xml file 2 142
Question about @INC variable in perl 1 76
read an xml file in perl 2 85
Perl Versus AWK? 7 96
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…

737 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