Godaddy Hosting / PHP Email Functions

Hello
I have found this thread http://www.sitepoint.com/forums/php-34/godaddy-hosting-php-email-functions-348488.html on google.
I have seen that it was closed.
But I do have a question to “cpellizzi”.
I have exactly same problem as “webclickusa” have. I created a custom form in flash,make a php script and host it on godaddy.com with deluxe account. I try to send email and did not receive anything. But when I found the above post and tried that script:

<?php

mail(“you@domain.com”, “test message from godaddy”, “this is a test message, if you are reading this the email was sent successfully.”);

?>

I did receive the email. So I think there is a problem in my script.
Cpellizzi can you help me please???:frowning:

Here is my PHP script I use:

&lt;?php
# Send to your email address
$sendTo = "pysiek@pysiek.com";
# Subject line
$subject = "Information Request";
# Send from address
$sendFrom = "FROM: Pysiek Website";
# Body 
$body = "A user has left the following information \
 \
 Name: " . stripslashes($_POST["yourName_txt"]) . " \
 Phone #: " . stripslashes($_POST["phone_txt"]) . "\
 Email Address: " . stripslashes($_POST["email_txt"]) . "\
 Comments: " . stripslashes($_POST["comments_txt"]);
# Send mail
mail($sendTo, $subject, $body, $sendFrom);
?&gt;

The thing is that I can use the above script that cpellizzi share but I would also like to add the Subject Line , Send from address , Name , Phone# , Email Address , Comments like in my script.

Here is the email message that godaddy support team send me. It might help:
"Dear Krzysztof,

Thank you for contacting Online Support.

We are unable to review custom scripting, however we can provide the use of our custom form mailers and detailed information on how to use them.

In order to be able to send email through our hosting accounts that we offer you must use the following relay server in your code:

relay-hosting.secureserver.net

You do not need to provide a user name and password for this relay server as it does not require authentication.

Two form mailers are included with new Windows shared hosting accounts: webformmailer.asp and gdform.php. To use a form mailer, create a Web form in HTML that links to one of our scripts and upload it to your hosting account.

NOTE: Do not use test@test.com to test your form mailer.

WARNING: The gdform.asp and gdform.php files cannot be recovered if they are deleted.

The form mailers are not installed until you specify the email address you want to use with the form mailer in your account manager. For more information, see http://help.godaddy.com/article/511

webformmailer.asp

To Use webformmailer.asp

Create a Web form, assigning unique names to your form fields.

In the form tag, assign _gdForm/webformmailer.asp to the action attribute and set the form method to post:

&lt;form action="_gdForm/webformmailer.asp" method="post"&gt;


In addition to the form fields you create, there are three hidden elements you can use.

form_format determines in what format the information is delivered. Its values are 'text', 'csv', 'html', 'xml', and 'default' (same as 'text').

form_order dictates in what order the fields are reported. Its values are 'default' (the same order as they appear on in the form), 'alpha' (alphabetized by field name) or a comma-separated, case-sensitive list of all or some field names.

form_interval determines the frequency and packaging of delivery. To receive one email per form submission, the form_interval values are 'default' (every 10 minutes), 'hourly', and 'daily'. To specify when the attached submissions are received, the form_interval values are 'digest', 'hourly_digest', and 'daily_digest'.

For example:

&lt;form action="_gdForm/webformmailer.asp" method="POST"&gt;
&lt;input type="hidden" name="subject" value="Submission" /&gt;
&lt;input type="hidden" name="redirect" value="thankyou.html" /&gt;
First Name: &lt;input type="text" name="FirstName" /&gt;
Last Name :&lt;input type="text" name="LastName" /&gt;
Email: &lt;input type="text" name="email" /&gt;
Comments: &lt;textarea name="comments" cols="40" rows="10"&gt;
Type comments here.&lt;/textarea&gt;
&lt;input type="submit" name="submit" value="submit"/&gt;
&lt;input type="hidden" name="form_order" value="alpha"/&gt;
&lt;input type="hidden" name="form_interval" value="hourly"/&gt;
&lt;input type="hidden" name="form_format" value="html"/&gt;
&lt;/form&gt;

NOTE: The webformmailer.asp file is accessed through a virtual directory. You cannot modify the file, and it does not display in the file manager.

gdform.php

Only Windows accounts running IIS7 can use gdform.php.

To Use gdform.php

Create your Web form as normal and assign unique names to your form items.

NOTE: Keep in mind that our form-mailer script will sort the names of your form items alphabetically when it composes the email message. This is the order of precedence: uppercase letters, lowercase letters, numbers.


For the form action line, enter /gdform.php. For example:
&lt;form action="/gdform.php" method="post"&gt;


Set the form method to "post."

In addition to the fields you create in your form, there are three special fields that you can use: subject, redirect, and email.

Subject. Controls the subject line in the form email.

Redirect. Controls the page that your visitors will see after they submit the form.

Email. Controls the return address for the form email.

For example:

&lt;form action="/gdform.php" method="post"&gt;
&lt;input type="hidden" name="subject" value="Form Submission" /&gt;
&lt;input type="hidden" name="redirect" value="thankyou.html" /&gt;
&lt;p&gt;First Name:&lt;input type="text" name="FirstName" /&gt;&lt;/p&gt;
&lt;p&gt;Last Name:&lt;input type="text" name="LastName" /&gt;&lt;/p&gt;
&lt;p&gt;E-Mail:&lt;input type="text" name="email" /&gt;&lt;/p&gt;
&lt;p&gt;Comments:&lt;textarea name="comments" cols="40" rows="10"&gt;
Type comments here.&lt;/textarea&gt;&lt;/p&gt;
&lt;input type="submit" name="submit" value="submit"/&gt;
&lt;/form&gt;


Save and upload your file to your hosting account.

gdform.asp

To Use gdform.asp

WARNING: As of October 29th, 2008, gdform.asp is no longer offered on Windows shared hosting accounts. If your account does not have gdform.asp, these instructions will not work.

Create your Web form as normal and assign unique names to your form items.

NOTE: Keep in mind that our form-mailer script will sort the names of your form items alphabetically when it composes the email message. This is the order of precedence: uppercase letters, lowercase letters, numbers.


For the form action line, enter gdform.asp. For example:
&lt;form action="gdform.asp" method="post"&gt;


Set the form method to "post."

In addition to the fields you create in your form, there are three special fields that you can use: subject, redirect, and email.

Subject. Controls the subject line in the form email.

Redirect. Controls the page that your visitors will see after they submit the form. If the page exists off your hosting root, the subdirectory must be specified.

Email. Controls the return address for the form email.

For example:

&lt;form action="gdform.asp" method="post"&gt;
&lt;input type="hidden" name="subject" value="Form Submission" /&gt;
'This example assumes thankyou.html resides in the hosting
'account root directory.
'The appropriate path must be supplied if the file
'exists in a subdirectory.

&lt;input type="hidden" name="redirect" value="thankyou.html" /&gt;
&lt;p&gt;First Name:&lt;input type="text" name="FirstName" /&gt;&lt;/p&gt;
&lt;p&gt;Last Name:&lt;input type="text" name="LastName" /&gt;&lt;/p&gt;
&lt;p&gt;E-Mail:&lt;input type="text" name="email" /&gt;&lt;/p&gt;
&lt;p&gt;Comments:&lt;textarea name="comments" cols="40" rows="10"&gt;
Type comments here.&lt;/textarea&gt;&lt;/p&gt;
&lt;input type="submit" name="submit" value="submit"/&gt;
&lt;/form&gt;


Save and upload your file to your hosting account.

NOTE: Your file and gdform.asp need to be placed in the same directory of your hosting account in order for the form to properly function. If the directory in which they reside is off your hosting account root, you must provide the complete confirmation page path in your code.

For information on reinstalling your default scripts, see http://help.godaddy.com/topic/97/article/4914

Otherwise, we will require a bounceback message in order to further troubleshoot.

Please let us know if we can further assist you.

Sincerely,
Tyler P.
Online Support Representative"

Okay guys I might put to many information in the post.
Here is simple question. Where do I need to insert the: " <form action=“/gdform.php” method=“post”> " line in my script:
<?php

Send to your email address

$sendTo = “pysiek@pysiek.com”;

Subject line

$subject = “Information Request”;

Send from address

$sendFrom = “FROM: Pysiek Website”;

Body

$body = "A user has left the following information

Name: " . stripslashes($_POST[“yourName_txt”]) . "
Phone #: " . stripslashes($_POST[“phone_txt”]) . "
Email Address: " . stripslashes($_POST[“email_txt”]) . "
Comments: " . stripslashes($_POST[“comments_txt”]);

Send mail

mail($sendTo, $subject, $body, $sendFrom);
?>