Forum Moderators: coopster & phranque

Message Too Old, No Replies

Send E-Mail out after entering a form not working.

         

Jesse_Smith

12:20 am on Mar 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Using a perl script, I'm trying to send an E-mail out to the visitors when they make a request to get contacted, with info on how to get off just incase they did not make the request, but the E-mail is not being sent out. The email address gets added to the database, but the E-mail is not created and sent to the visitor. The code looks like this....

Near the top....

$mailprog = '/usr/sbin/sendmail -i -t';

(Same as on my form mail script to get E-mail from forms.)

Past the middle of the script....

#Open The Mail Program
open(MAIL,"¦$mailprog");
print MAIL "To: $FORM{'email'}\n";
print MAIL "From: pokemon@example.com\n";
print MAIL "Product request for $FORM{'subject'}\n";
print MAIL "At your request you will be contacted when $FORM{'subject'} is ready to order on procduct name. If you did not make this request, reply with blah.....\n";
close (MAIL);

[edited by: jatar_k at 1:22 am (utc) on Mar. 22, 2004]
[edit reason] generalized [/edit]

tombola

10:16 pm on Mar 21, 2004 (gmt 0)

10+ Year Member



print MAIL "From: pokemon@example.com\n";

You must escape the @ sign in that email address, thus:

print MAIL "From: pokemon\@example.com\n";

[edited by: jatar_k at 1:23 am (utc) on Mar. 22, 2004]
[edit reason] generalized [/edit]

Jesse_Smith

5:51 am on Mar 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That got rid of the ISE message when the email code stuff is there, but still doesn't send out the E-mail.

With -w at the end of the first line I get some errors in su telnet. Here's the errors and then the code at that line.

Use of uninitialized value in read at contact.cgi line 6.
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

Use of uninitialized value in string ne at contact.cgi line 23.
if ($database ne '') {

Use of uninitialized value in string eq at dvd_contact.cgi line 36.
Use of uninitialized value in pattern match (m//) at dvd_contact.cgi line 36.
Content-type: text/html

if ($FORM{'url'} eq 'mailto:' ¦¦ $FORM{'url'}!~ /^(f¦ht)tp:\/\/\w+\.\w+/) {

Use of uninitialized value in concatenation (.) or string at dvd_contact.cgi line 43.
Use of uninitialized value in concatenation (.) or string at dvd_contact.cgi line 43.
Use of uninitialized value in concatenation (.) or string at dvd_contact.cgi line 43.

print <<EOM;

Would any of this keep the E-mail from being sent out? Everything else works.