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: Intermediate:
Sendmail wont send to email address from data file.

 



CuzDesign
Deleted

Oct 2, 2000, 11:05 AM

Post #1 of 1 (321 views)
Sendmail wont send to email address from data file. Can't Post

Hello,
Hopefully someone can help me here. I have been at this forever it seems and cannot find the problem.
What I am trying to do is open a data file and read in the email address for each record. After I get the
first I send the email to it and so on for the rest. But for some reason it never sends out the emails. Here is
the code I am using. Any help would be greatly appreciated.


code:

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


$name = "Webmaster";
$webmasteremail = "webmaster\@cuzzart.com";
$mail_prog = "/usr/sbin/sendmail";

$emailinsert="../log_files/specials.txt";

$logfile = "../log_files/orderdatalog.dat";

open(DATALOG, "<$logfile");
@all=<DATALOG>;
foreach $line (@all){
@fields = split(/:/, $line);
# START TO SEND THE E-MAIL OUT
open (MAIL, "|$mail_prog -t");
print MAIL "To: $fields[14]\n";
print MAIL "From: $name <$webmasteremail>\n";
print MAIL "Subject: $first, specials of the month!\n";
print MAIL "Content-type: text/plain\n\n";

# Print the body of the email
print MAIL "Hello $first,\n ";
open (FIL,$emailinsert) | | die "couldn't open $emailinsert";
while (<FIL> ){
$data=$_;
print MAIL "$data";
}
}
</pre><HR></BLOCKQUOTE>

Data fiel is setup like so:

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


($id, $inv, $auth, $when, $transid, $total, $first, $lastname, $address, $city, $state, $zip, $country, $phone, $email) = split(/:/, $_);
</pre><HR></BLOCKQUOTE>

The email address is in the last $field[14] for some reason it will not send out the email to not even the first email address.

I have checked the path to sendmail and it is right, so I cannot see what is going wrong here.

Any help would be greatly appreciated.

Thanks in advance.

Ray

[This message has been edited by CuzDesign (edited 10-02-2000).]

 
 


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

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