Jump to content
tramadius

Need Help Setting Up Php Sendmail Script In Flash

Recommended Posts

I've been having unable to get the TCH Autoresponder to send an autoresponse to the form recipient's email. However, the Autoresponder works perfectly if I send an email directly from my email client. I have programmed the PHP sendmail script to work in conjunction with the Flash at my client's website, lafamiglia.com (the forms can be found at the following pages within the site: Comments, Contact, Reservation)

 

The following is the response I received from the TCH Help Desk in regards to my issue:

 

The mails that is generating from the php/cgi mail forms as "nobody@habs.tchmachines.com" - not with any other specific email. The auto responder is trying to send out to this mail account nobody@habs.tchmachines.com and it will not work

 

Please see the mail logs of a mail that is generated from Contact form

 

2009-01-18 21:51:11 1LOkEJ-000679-2J <= nobody@habs.tchmachines.com U=nobody P=local S=640

2009-01-18 21:51:11 no host name found for IP address 118.175.22.202

2009-01-18 21:51:11 1LOkEJ-000679-2J => reservation <****@lafamiglia.com> R=virtual_user T=virtual_userdelivery

2009-01-18 21:51:11 1LOkEJ-000679-2J => webmaster <****@lafamiglia.com> R=virtual_user T=v

 

There is upgraded version of mail script available that will generate mails as a real user than "nobody" - then you can set auto responder for that.

 

I'm not really sure how to get this to work or how to upgrade the script. Anybody have any ideas? Here is the PHP script that I am using:

 

<?php

 

$search = array('&', 'ñ', 'Ñ', 'á', 'é', 'í', 'ó', 'ú', 'Á', 'É', 'Í', 'Ó', 'Ú');

$replace = array('&', 'ñ', 'Ñ', 'á', 'é', 'í', 'ó', 'ú', 'Á', 'É', 'Í', 'Ó', 'Ú');

 

$fecha = date("D-M-y H:i");

$mymail = "****@lafamiglia.com, ****@lafamiglia.com";

$subject = "Website Comment";

$contenido = "Name: ".$_POST["name"]."\n";

$contenido .= "Email: ".$_POST["email"]."\n\n";

$contenido .= "Comment: ".$_POST["comment"]."\n\n";

$contenido .= "The message was wrote ".$fecha;

 

$contenido = str_replace($search, $replace, $contenido);

 

$header = "From:".$_POST["name"]."\nReply-To:".$_POST["email"]."\n";

$header .= "X-Mailer:PHP/".phpversion()."\n";

$header .= "Mime-Version: 1.0\n";

$header .= "Content-Type: text/plain";

 

mail($mymail, $subject, utf8_decode($contenido) ,$header);

echo "&estatus=ok&";

?>

Share this post


Link to post
Share on other sites

You need to have your script send email as a real user and not the webserver "nobody".

 

>mail($mymail, $subject, utf8_decode($contenido) ,$header, -f"real-email-address");

Share this post


Link to post
Share on other sites
You need to have your script send email as a real user and not the webserver "nobody".

 

>mail($mymail, $subject, utf8_decode($contenido) ,$header, -f"real-email-address");

 

 

Thanks. I realize that I need to have the script send email as a real user. I'm just not sure how to go about it...

Share this post


Link to post
Share on other sites
You need to have your script send email as a real user and not the webserver "nobody".

 

>mail($mymail, $subject, utf8_decode($contenido) ,$header, -f"real-email-address");

 

Oooh, it's too early. Now I see it. Thanks for forwarding that! I'll give it a try.

Share this post


Link to post
Share on other sites
Oooh, it's too early. Now I see it. Thanks for forwarding that! I'll give it a try.

 

I tried inserting -f"real-email-address" but it causes the form to fail (I replaced "real-email-address" with an actual email address). Am I doing something wrong?

 

 

On another note, is there anyway to remove the two email addresses I mentioned in the original post? I believe the spam bots are already picked up on them.

Share this post


Link to post
Share on other sites

I think I made a mistake with the command. Move the quote to the left of the -f

 

>mail($mymail, $subject, utf8_decode($contenido) ,$header, "-freal-email-address");

 

I have edited your first post (email addresses)

Share this post


Link to post
Share on other sites
I think I made a mistake with the command. Move the quote to the left of the -f

 

>mail($mymail, $subject, utf8_decode($contenido) ,$header, "-freal-email-address");

 

I have edited your first post (email addresses)

 

 

Thanks. The form works now. However, still no autoresponder coming through. Do I need to put an actual email address in this snippet "-freal-email-address" ?

Share this post


Link to post
Share on other sites

Yes, you need to put an actual email address in there. So it would be "-fyou@your-domain.ext"

Share this post


Link to post
Share on other sites
Yes, you need to put an actual email address in there. So it would be "-fyou@your-domain.ext"

 

Thanks again. I implemented it but it's still a no go on the autoresponder. The form comes through fine but no autoresponse is received. Strange...

Share this post


Link to post
Share on other sites
It may be that it's not possible.

 

I've seen autoresponders work on other Flash sites. I suppose I'll have to keep looking.

Share this post


Link to post
Share on other sites
I've seen autoresponders work on other Flash sites. I suppose I'll have to keep looking.

 

Does anyone know of any other resources that I can pursue? I've looked on quite a few discussion groups and forums but I don't see anyone else having this issue.

 

Thanks.

Share this post


Link to post
Share on other sites

Have you updated your ticket and had the techs check the mail logs since you have made the recent changes? Having them check again will let you know if the change had any affect.

Share this post


Link to post
Share on other sites
Have you udpated your ticket and had the techs check the mail logs since you have made the recent changes? Having them check again will let you know if the change had any affect.

No I haven't. I'll go ahead and give that a try. Thanks.

Share this post


Link to post
Share on other sites
Have you udpated your ticket and had the techs check the mail logs since you have made the recent changes? Having them check again will let you know if the change had any affect.

I went ahead and updated the ticket with a request to check the log. Please keep in mind that I only implemented the suggested fix for the Contact form only. The Reservation and Comment forms still have the old code.

 

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×