Jump to content


Photo

Need Help Setting Up Php Sendmail Script In Flash


  • Please log in to reply
14 replies to this topic

#1 tramadius

tramadius

    Family Friend

  • Members
  • PipPip
  • 28 posts

Posted 19 January 2009 - 12:33 AM

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('&amp;', '&ntilde;', '&Ntilde;', '&aacute;', '&eacute;', '&iacute;', '&oacute;', '&uacute;', '&Aacute;', '&Eacute;', '&Iacute;', '&Oacute;', '&Uacute;');

$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&";
?>



#2 TCH-Bruce

TCH-Bruce

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 20,149 posts

Posted 19 January 2009 - 08:06 AM

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");

Bruce Richards
Forum Moderator
TotalChoice Hosting, Inc.
Webhosting by Total Choice Web Hosting - General Support Forum

I am a Forum Moderator. While I can assist in answering most of your hosting related questions, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.


#3 tramadius

tramadius

    Family Friend

  • Members
  • PipPip
  • 28 posts

Posted 19 January 2009 - 09:59 AM

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...

#4 tramadius

tramadius

    Family Friend

  • Members
  • PipPip
  • 28 posts

Posted 19 January 2009 - 10:00 AM

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.

#5 tramadius

tramadius

    Family Friend

  • Members
  • PipPip
  • 28 posts

Posted 19 January 2009 - 10:35 AM

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.

#6 TCH-Bruce

TCH-Bruce

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 20,149 posts

Posted 19 January 2009 - 11:11 AM

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)

Bruce Richards
Forum Moderator
TotalChoice Hosting, Inc.
Webhosting by Total Choice Web Hosting - General Support Forum

I am a Forum Moderator. While I can assist in answering most of your hosting related questions, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.


#7 tramadius

tramadius

    Family Friend

  • Members
  • PipPip
  • 28 posts

Posted 19 January 2009 - 11:31 AM

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" ?

#8 TCH-Bruce

TCH-Bruce

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 20,149 posts

Posted 19 January 2009 - 12:15 PM

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

Bruce Richards
Forum Moderator
TotalChoice Hosting, Inc.
Webhosting by Total Choice Web Hosting - General Support Forum

I am a Forum Moderator. While I can assist in answering most of your hosting related questions, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.


#9 tramadius

tramadius

    Family Friend

  • Members
  • PipPip
  • 28 posts

Posted 19 January 2009 - 12:36 PM

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...

#10 TCH-Bruce

TCH-Bruce

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 20,149 posts

Posted 19 January 2009 - 05:42 PM

It may be that it's not possible.

Bruce Richards
Forum Moderator
TotalChoice Hosting, Inc.
Webhosting by Total Choice Web Hosting - General Support Forum

I am a Forum Moderator. While I can assist in answering most of your hosting related questions, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.


#11 tramadius

tramadius

    Family Friend

  • Members
  • PipPip
  • 28 posts

Posted 19 January 2009 - 06:07 PM

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.

#12 tramadius

tramadius

    Family Friend

  • Members
  • PipPip
  • 28 posts

Posted 20 January 2009 - 01:14 PM

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.

#13 TCH-Dick

TCH-Dick

    General Manager

  • Admins
  • PipPipPipPip
  • 5,891 posts

Posted 20 January 2009 - 01:49 PM

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.

Dick DeVance
General Manager
TotalChoice Hosting, Inc
dick@totalchoicehosting.com


Posted Image


#14 tramadius

tramadius

    Family Friend

  • Members
  • PipPip
  • 28 posts

Posted 20 January 2009 - 02:01 PM

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.

#15 tramadius

tramadius

    Family Friend

  • Members
  • PipPip
  • 28 posts

Posted 20 January 2009 - 02:19 PM

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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users