WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-10-2003, 10:39 AM
Diesel Diesel is offline
WebProWorld New Member
 

Join Date: Jul 2003
Posts: 1
Diesel RepRank 0
Default PHP mail script

Hello

A website I've built for a client is having some issues with the PHP mailer I've built for it. I've used this code on over 5 sites and they all work except this one.

Quote:
<?php
if($sentemail == "2"){
include("sorry.php");

}else{

$num = $sentmessage + 1;
setcookie("sentemail","$num",time()+600); //set the cookie

$emailmsg = "Sender Name:\t$name
E-Mail:\t$email\n\n
E-mail Subject:\t$emailsubject\n
Message:
\t$emailmessage\n
Contact Information:
\t$address
\t$city, $state $zip\n";
$to = "anyone@anywhere.com";
$subject = "Information Request";
$mailheaders = "From: $email <> \n";
$mailheaders .= "Reply-To: $email\n\n";
mail($to, $subject, $emailmsg, $mailheaders);
include("thanksecho.php");
}
?>
Once he installed this to his server we found out that he did not have PHP installed. So I installed it on his server and configured the .ini file. This is the error that I receive.
Quote:
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in e:\blakleysinternet\thanks3.php on line 22
I've set the "sendmail_from" in the .ini file but that didn't seem to help any. I've tried a couple other things but nothing seems to work. Since the code is used ,and working, on several other sites I feel its a problem in the .ini or server. Any ideas?
Reply With Quote
  #2 (permalink)  
Old 12-10-2003, 02:33 PM
redcircle's Avatar
redcircle redcircle is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Grand Rapids, MI USA
Posts: 553
redcircle RepRank 0
Default

how are the values input into the email. are they from a form or database. Take a look at register_globals. If register_globals is off then you will need to use the superglobals $_POST['email'] or $_GET['email']
Reply With Quote
  #3 (permalink)  
Old 12-26-2003, 01:36 PM
datahound datahound is offline
WebProWorld New Member
 

Join Date: Dec 2003
Location: UK
Posts: 21
datahound RepRank 0
Default Headers need ""

Headers need "",

I would suggest you try changing this line

mail($to, $subject, $emailmsg, "$mailheaders");

Let me know if it works.
__________________
Michael Thrower
Computer Broker
www.datahound.co.uk
Reply With Quote
  #4 (permalink)  
Old 12-26-2003, 01:45 PM
redcircle's Avatar
redcircle redcircle is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Grand Rapids, MI USA
Posts: 553
redcircle RepRank 0
Default

putting quotes around a variable will do nothing.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: mail, php, script



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Search Engine Friendly URLs by vBSEO 3.0.0