CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Perl Mailing program

 



Eisenhower Webmaster
Deleted

Mar 29, 2000, 8:18 AM

Post #1 of 3 (819 views)
Perl Mailing program Can't Post

I have been configuring a script to parse forms but I'm not sure what exactly the mailing program is that I need to send mail. What is this program and is there anywhere I can get it?


Cure
User

Mar 28, 2000, 10:48 PM

Post #2 of 3 (819 views)
Re: Perl Mailing program [In reply to] Can't Post

Hi

TO Send e-mail to an individual you can a program called sendmail(unix base) http://www.sendmail.org/

If your using a SMTP(server) to send e-mail then you can use Net::SMTP module or Mail::Sender module.

Cure


Rivotti
User

Mar 30, 2000, 7:52 AM

Post #3 of 3 (819 views)
Re: Perl Mailing program [In reply to] Can't Post

Hi Eisenhower:

Here's two examples for sending mail.

Using Sendmail:
<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

$to = 'other@site.com'; # here the address you wanto to send the mail
$from = 'me@site.com'; # here your address
$maildir = '/usr/sbin/sendmail'; # here the path to sendmail program. It's usually this.

open (SENDMAIL, "| $maildir -t");
print SENDMAIL "From: $from\n";
print SENDMAIL "To: $to\n";
print SENDMAIL "Subject: Mail\n";
print SENDMAIL "Write the message here";
close (SENDMAIL);
</pre><HR></BLOCKQUOTE>

Using NET::SMTP
<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

use NET::SMTP # you must use this line

$to = 'other@site.com'; # here the address you wanto to send the mail
$from = 'me@site.com'; # here your address
$server = 'your mail host here';

$smtp-> NET::SMTP->new($server);
$smtp->mail($ENV{USER});
$smtp->from($from);
$smtp->to($to);

$smtp->data();
$smtp->datasend("From: $from\n");
$smtp->datasend("To: $to\n");
$smtp->datasend("Subject: Mail\n");
$smtp->datasend("You can write your message here\n");
$smtp->dataend();
$smtp->quit;
</pre><HR></BLOCKQUOTE>

These are the basic. You should consult CPAN in www.perl.com for more info

Rivotti

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives