Topic: Oracle on Unix/Linux >> sending email w/ perl script
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Title: sending email w/ perl script |
| du365 |
Posted: Aug 04, 2003 01:59:00 PM |
Total Post: 6
Joined: Jan, 2003
|
i'm trying to figure out a way to send email to a group of users using perl script,
but their email addresses are stored in oracle DB. here's the perl script send mail code i'm gonna use:
use Net::SMTP;
$smtp = Net::SMTP->new('here.com'); # connect to an SMTP server
$smtp->mail( 'user@here.com' ); # use the sender's address here
$smtp->to('user@there.com'); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
$smtp->datasend("To: user@there.com\n");
$smtp->datasend("From: user@here.com\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("Hello, World!\n");
$smtp->dataend(); #Finish sending the mail
$smtp->quit;
i want to query all the addresses every time before i run the perl script, and then push all the addresses into the "To" field...
but i dunno how to go about doing it...
any help would be appreciated...
|
|
|
Sabari Nath |
| Posted: Aug 04, 2003 09:33:00 PM | |
|
Total Post: 16
Joined: Jan, 2003
|
You can use sql script to find out the emails from the database. Use this script output file as input for the perl script.
sqlplus userid/password@db <
@email_script.sql
EOF
Hope it works for you.
Regards,
Vasu
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gopu Gopi | 333 |
| Gitesh Trivedi | 322 |
| Vinoth Kumar | 264 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|