Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Send email using Perl

Reply
Thread Tools

Send email using Perl

 
 
Ning li
Guest
Posts: n/a
 
      09-14-2003
Hi,

I am new to Perl and I would like to know the Perl equivalent of this
Unix mail command:

mailx -s "My Subject Here" http://www.velocityreviews.com/forums/(E-Mail Removed) < my_file_name

Thanks in advance.

Nick Li




 
Reply With Quote
 
 
 
 
Mina Naguib
Guest
Posts: n/a
 
      09-14-2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ning li wrote:
> Hi,
>
> I am new to Perl and I would like to know the Perl equivalent of this
> Unix mail command:
>
> mailx -s "My Subject Here" (E-Mail Removed) < my_file_name


system qq|mailx -s "My Subject Here" (E-Mail Removed) < my_file_name|;

or

`mailx -s "My Subject Here" (E-Mail Removed) < my_file_name`;

or

open (FH, "| mailx") or die . .;
print to FH

or the best, perl-ish way :

perldoc Net::SMTP

Best of luck.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/Y9pMeS99pGMif6wRAggqAKCLN9K5lM5fzboinKZpr9WrymPeBg CgjBhT
wcLgZCyIeLgdcTK2tCyIaF8=
=EVL3
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
 
Bill Zhao
Guest
Posts: n/a
 
      09-15-2003

"Ning li" <(E-Mail Removed)> gl
news:I6P8b.140824$(E-Mail Removed)...
> Hi,
>
> I am new to Perl and I would like to know the Perl equivalent of this
> Unix mail command:
>
> mailx -s "My Subject Here" (E-Mail Removed) < my_file_name

in perl:
if (`mailx -s "My Subject Here" (E-Mail Removed) < my_file_name`) {
die "Mail Send Fail ";
}

>
> Thanks in advance.
>
> Nick Li
>
>
>
>



 
Reply With Quote
 
Sam Holden
Guest
Posts: n/a
 
      09-15-2003
On Mon, 15 Sep 2003 15:51:08 +0800, Bill Zhao <(E-Mail Removed)> wrote:
>
> "Ning li" <(E-Mail Removed)> gl
> news:I6P8b.140824$(E-Mail Removed)...
>> Hi,
>>
>> I am new to Perl and I would like to know the Perl equivalent of this
>> Unix mail command:
>>
>> mailx -s "My Subject Here" (E-Mail Removed) < my_file_name

> in perl:
> if (`mailx -s "My Subject Here" (E-Mail Removed) < my_file_name`) {
> die "Mail Send Fail ";
> }


Did you even think about that for a second? Did you really want to
interpolate the array @mail into that command?

Why does mailx indicate failure by outputting to stdout? That seems like
a remarkably stupid way of indicating failure.

Of course it probably doesn't. It's far more likely you just don't know
how to execute a command correctly in perl...

--
Sam Holden

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
which email module - MIME::LITE, Email::Send, other? brewsterbear@googlemail.com Perl Misc 2 01-05-2007 09:45 AM
Cannot compose ,reply or send email on Sasktel email system pcbutts1 Computer Support 5 07-29-2005 06:13 AM
why cant i send email messages from this email Billie Jo Ames Computer Support 8 06-30-2005 12:24 PM
perl in Windows: using the "Send To" folder and perl Adam S Perl Misc 2 09-23-2004 12:55 PM
HowTo:? open email client to send email Peter ASP .Net 0 07-01-2003 04:58 PM



Advertisments