Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending mail

Status
Not open for further replies.

bretttt

Programmer
Joined
Jul 23, 2002
Messages
74
Location
US
Can someone please give me the most basic example to send mail? thanks. All i want in the email is text, no html or files or anything.
 
can someone please help me send a simple email with subject and message just saying hello?

PLEASE!!
 

#!/usr/bin/perl
#
# testSendMail.pl -- This is a simple example of using SendMail.pm module
# to send a mail.
#
# Simon Tneoh Chee-Boon tneohcb@pc.jaring.my
#
# Copyright (c) 1998 Simon Tneoh Chee-Boon. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#

#
# Please refer to
# # for more information about SendMail.pm module.
#
use SendMail;

#
# Create the object without any arguments,
# i.e. localhost is the default SMTP server.
#
$sm = new SendMail();

#
# We set the debug mode "ON".
#
$sm->setDebug($sm->ON);

#
# We set the sender.
#
$sm->From(&quot;Your Name <brett.gralinski\@verizon.net>&quot;);

#
# We set the subject.
#
$sm->Subject(&quot;CUSTOMER SERVICE BITCH! Damm You Guys Fuckin Suck&quot;);

#
# We set the recipient.
#
$sm->To(&quot;Recipient <vze35fs5\@verizon.net>&quot;);

#
# We set the content of the mail.
#
$sm->setMailBody(&quot;RESOLVE MY ACCOUNT RESTRICTION NOW!!!&quot;);

#
# Check if the mail sent successfully or not.
#
if ($sm->sendMail() != 0) {
print $sm->{'error'}.&quot;\n&quot;;
exit -1;
}

#
# Mail sent successfully.
#
print &quot;Done\n\n&quot;;
exit 0;
 
how do i run this thing?? please help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top