PHP E-MAIL FORM-FASTHOST FILTERS

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Andreas
Forum Newbie
Posts: 2
Joined: Fri Mar 26, 2004 3:24 am

PHP E-MAIL FORM-FASTHOST FILTERS

Post by Andreas »

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!
Andreas
Forum Newbie
Posts: 2
Joined: Fri Mar 26, 2004 3:24 am

Post by Andreas »

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 ";
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

try putting it as one of the first things in your script

Code: Select all

<?
ini_set("sendmail_from", " email@mydomain ");

// all your other code, unless your using session_start() which should always be first

?>
Mark
Post Reply