[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] SMTP from site on same server
- Subject: Re: [cobalt-users] SMTP from site on same server
- From: "ML Waltmans" <spam@xxxxxxxxxx>
- Date: Tue Jan 29 03:28:00 2002
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
You can use the following code within your CGI program, to send email
through an STMP server.
# Change these
$mailbodydata = "The body text.";
$sender = "Your Name <your\@name.com>";
$subject = "The subject";
$recipient = "The Recipient <the\@recipient.com>";
$mailserver = www.yoursmtpserver.com;
# The code
use SendMail;
$obj=new SendMail($mailserver,25);
$obj->From($sender);
$obj->Subject($subject);
$obj->To($recipient);
$obj->setMailBody($mailbodydata);
if($obj->sendMail()!=0){
print$obj->{'error'}."\n";
}
$obj->reset();
Greetings,
Martin
www.isaeus.nl