in reply to Re: Re: emailing with an address taken from a database
in thread emailing with an address taken from a database
Any ideas why it should work like that but not in the previous version? (At least this gives me a basis to start looking but there might be something obvious which I'm not getting).#!/usr/bin/perl -w use strict; use CGI; my $query = new CGI; my $thisurl = "http://www.my_site.com/cgi-bin/email.pl"; my $id_in=$query->param('id_in'); my $Guest_Email=$query->param('Guest_Email'); my $check=$query->param('check'); my $Email_address; my ($Password,$U_Timestamp,$three,$four,$skipthisfield); my @emailer = (); my $data="/path/data/edit/data.txt"; open (FILE, "$data"); while (my $line =<FILE>) { ($Password,$U_Timestamp,$three,$four,$skipthisfield) = split "\t", +$line; if ($id_in eq $three) { $Email_address = $four; last; } } print "Content-type: text/html\n\n"; my $sendmailer; my $emailto; my $emailfrom; my $message_no; my $message; $sendmailer="/usr/sbin/sendmail"; $emailto="$Email_address"; $emailfrom="enquiry\@my_site.com"; print "Email is: $Email_address"; open (MAIL, "| $sendmailer -t") || die "sendmailer: $!"; print MAIL "To: $emailto\n"; print MAIL "From: $emailfrom\n"; print MAIL "Subject: Request for information\n"; print MAIL "Content-type: text/html\n\n"; print MAIL "<html><body><p>\n"; print MAIL "<font size=\"2\" color=\"#CC0000\">\n"; print MAIL "<u>REQUEST FOR INFORMATION</u><BR><BR>\n"; print MAIL "I am interested in receiving information on : $id_in<BR>\n +"; print MAIL "blah\n"; print MAIL "Any other comments:<BR>\n"; print MAIL "$message<br>\n"; print MAIL "</font></body></html>\n"; last; close(MAIL); close(MAIL);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: emailing with an address taken from a database
by jonnyfolk (Vicar) on Feb 11, 2003 at 15:54 UTC |