
CuzDesign
Deleted
Oct 1, 2000, 2:05 PM
Post #1 of 3
(304 views)
|
Help, with sending email!
|
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. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> # Name of webmaster $name = "Webmaster"; # Webmasters email $webmasteremail = "webmaster\@cuzzart.com"; # Path to sendmail. $mail_prog = "/usr/lib/sendmail"; # Path to specials.txt file $emailinsert="../log_files/specials.txt"; # Path to Log file $logfile = "../log_files/orderdatalog.dat"; # Open log file open (DATALOG, "$logfile") | | die "Can't Open $logfile"; while(<DATALOG> ) { ($id, $inv, $auth, $when, $transid, $total, $first, $lastname, $address, $city, $state, $zip, $country, $phone, $email) = split(/:/, $_); foreach ($inv) { # START TO SEND THE E-MAIL OUT open (MAIL, "|$mail_prog -t"); print MAIL "To: $email\n"; print MAIL "From: $name <$webmasteremail>\n"; print MAIL "Subject: $first, take a look at this site!\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"; } close (MAIL); } } </pre><HR></BLOCKQUOTE> Thanks in advance. Ray
|