Gossamer Forum
Home : General : Perl Programming :

Send mail usgin NT and sockets....

Quote Reply
Send mail usgin NT and sockets....
Can anyone write me a quick sub to send mail using sockets? My variables that i want to send are as follows:

the subject - "$subject"
send to - "info\@ceglobe.com"
from - $email

and in the message part:

the message - $comments
the ip - $ip

I know how to do this with sendmail, but haven't the slighest idea with sockets. Any help would be appreciated. Thanks,

Nicholas

------------------
Quote Reply
Re: Send mail usgin NT and sockets.... In reply to
Hi,

Look at:

http://www.perl.com/...-Sender-0.6.7.tar.gz

It provides a nice interface to send mail using SMTP.

Cheers,

Alex
Quote Reply
Re: Send mail usgin NT and sockets.... In reply to
Thanks for the response Alex. However, I don't have telnet access so i can't install this module. Do you know how the UBB sends their mail with sockets? I know it works on my server, but I can't figure what to put in my script.Thanks again,

Nicholas

------------------
Quote Reply
Re: Send mail usgin NT and sockets.... In reply to
Or you could use the Mailer.pm module which works with Sockets. Just add it in then do:

my $mailer = new Mailer ( { smtp => 'someserver.com' } ) or die "Mail: $Mailer::error";
$mailer->send ( { to => 'joe@joe.com', from => 'blah@blah.com', subject => 'Testing..', msg => $messagebody } ) or die "Mail: $Mailer::error";

Hope that helps,

Alex
Quote Reply
Re: Send mail usgin NT and sockets.... In reply to
I tried it and got this error:
Code:
Can't locate object method "new" via package "Mailer" at d:\http\ceglobe\cgi-bin\feedback.cgi line 384.

Any ideas? thanks,
Nicholas

------------------
Quote Reply
Re: Send mail usgin NT and sockets.... In reply to
Opps. I'm an idiot. I forgot the require statement. Thank you, this works!

------------------