Jeff 5

Hi folks,

I made a PHP script which takes the contents of an HTML form (that the user filled out) and e-mails it twice--one copy to the user who filled it out, and one copy to us (info@ourdomain.com).

The problem is, our email (info@ourdomain.com) has an auto-responder, and it tries to send out an e-mail to the web site which submitted the form! So every time someone submits the form, we get a copy of the form AND a mail-daemon delivery failure which says something like "cannot send mail to www.ourdomain.com@ourhost.com".

How can I fix this? Our host doesn't seem to have an "exclusion" option for the auto-responder. Is there something I can do with the headers?

Thanks! Jeff

  • Hey Jeff, you could probably find an answer more readily at stackoverflow.com, a site similar to this one, but more geared toward programming than CSS/Markup/Design. Zack Doherty over 6 years ago

3 answers

o.k.w 2355
1
point

Looks like your 'from' and/or 'reply-to' email addresses weren't configured and the system used a default one.

Look at the php mail function manual here. You can configure those fields within the mail header. E.g.:

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n";

mail($to, $subject, $message, $headers);
?>
Answered almost 7 years ago by o.k.w
Jeff 5
0
points

I've already got those headers :( I also added "Return-Path: webmaster@example.com"

When the e-mail arrives, the From and Reply-To fields look fine, though it does say "mailed-by: web.pas.earthlink.net".

Still, the auto-reply tries to send an e-mail to the actual sender (the server), not who I listed as the sender.

For now, I've marked that particular mail-daemon message as spam, and they've stopped coming, but that doesn't seem like a very good solution...

Anyway, thanks for your help so far!

Answered almost 7 years ago by Jeff
  • Hm.. weird indeed. Perhaps the problem lies with the autoresponder? o.k.w almost 7 years ago
salsan 0
0
points

Thanks for useful information. I would try it. I want to add form builder as a nice tool for creating any forms on your web site.

Answered over 6 years ago by salsan