Hello
i have this php -from to email in my web site (http://www.netnovelty.com)
Now my web host has several filters. My script was not working on my web site,but when i uploaded to another web server it worked fine. The web host has the following requirements..
This is the script
<?php
$message = "Details Below.\n\n";
if ($mname) // Check for Name input
{
$mailer = "Name - $mname"; // Create a line for the email message
$message .= "$mailer\n "; // Add it to the message
}
if ($email) // Check for Name input
{
$mailer = "Email Address: $email"; // Create a line for the email message
$message .= "$mailer\n"; // Add it to the message
}
$message .= "Email Body :\n\n";
if ($mains) // Check for Name input
{
$mailer = "$mains"; // Create a line for the email message
$message .= "$mailer/n"; // Add it to the message
}
mail("info@netnovelty.com", "$subject", $message, "From: $email");
ini_set("sendmail_from", " info@netnovelty.com");
echo "mail has been send successfully ";
?>
The host requires the following..:
PHP on Windows
Use the PHP mail function and set the mail from using the following line of code - replacing email@mydomain with the correct domain name.
ini_set("sendmail_from", " email@mydomain ");
So in order for the script to work,,the host requires the above function,,,as it says,,, but were to i put that function,, i have no idea how to do it,,any thoughtd? Cheers!
PHP E-MAIL FORM-FASTHOST FILTERS
Moderator: General Moderators
mail("info@netnovelty.com", "$subject", $message, "From: $email");
ini_set("sendmail_from", " info@netnovelty.com"); <---------Was just experementing with this bit-------->
echo "mail has been send successfully ";
ini_set("sendmail_from", " info@netnovelty.com"); <---------Was just experementing with this bit-------->
echo "mail has been send successfully ";
try putting it as one of the first things in your script
Mark
Code: Select all
<?
ini_set("sendmail_from", " email@mydomain ");
// all your other code, unless your using session_start() which should always be first
?>