garydt Posted April 8, 2007 Share Posted April 8, 2007 I'm trying to get the website to email me some values but i get error- Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files\xampp\htdocs\epeople\regcomplete.php on line 48 This is in the php.ini- [mail function] ; For Win32 only. SMTP = smtp.tiscali.co.uk smtp_port = 25 ; For Win32 only. sendmail_from = garydt88@tiscali.co.uk <?php require_once('Connections/elvisdb.php'); ?> <?php session_start(); if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $user = ($_SESSION['MM_Username']); $colname_Recordset1 = "-1"; if (isset($_SESSION['MM_Username'])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']); } mysql_select_db($database_elvisdb, $elvisdb); $query_Recordset1 = sprintf("SELECT * FROM images WHERE usnm = '$user'", GetSQLValueString($colname_Recordset1, "text")); $Recordset1 = mysql_query($query_Recordset1, $elvisdb) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $from = $row_Recordset2['usnm']; $photo = $row_Recordset2['imageName']; $totalRows_Recordset1 = mysql_num_rows($Recordset1); $to = "garydt88@tiscali.co.uk"; $header = "photo"; mail($to,$from,$header,$message); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> registration complete </body> </html> <?php mysql_free_result($Recordset1); ?> Quote Link to comment Share on other sites More sharing options...
metrostars Posted April 8, 2007 Share Posted April 8, 2007 the order goes mail("To", "Subject", "Message", Additional headers); $from must also be "From: " . $row_recordset2['usnm'] and must be an email address. a name will not suffice. Quote Link to comment Share on other sites More sharing options...
garydt Posted April 8, 2007 Author Share Posted April 8, 2007 Thanks. I changed the code to what you said but i'm still getting the same error. mysql_select_db($database_elvisdb, $elvisdb); $query_Recordset1 = "SELECT email FROM userinformation"; $Recordset1 = mysql_query($query_Recordset1, $elvisdb) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $From = $row_Recordset2['email']; $totalRows_Recordset1 = mysql_num_rows($Recordset1); $user = ($_SESSION['MM_Username']); $colname_Recordset1 = "-1"; if (isset($_SESSION['MM_Username'])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']); } mysql_select_db($database_elvisdb, $elvisdb); $query_Recordset1 = sprintf("SELECT * FROM images WHERE usnm = '$user'", GetSQLValueString($colname_Recordset1, "text")); $Recordset1 = mysql_query($query_Recordset1, $elvisdb) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $Message = $row_Recordset2['imageName']; $totalRows_Recordset1 = mysql_num_rows($Recordset1); $To = "garydt88@tiscali.co.uk"; $Subject = "photo"; mail("$To", "$Subject", "$From", "$Message"); I also changed the php.ini - [mail function] ; For Win32 only. SMTP = smtp.tiscali.co.uk smtp_port = 25 ; For Win32 only. sendmail_from = $row_Recordset2['email'] Quote Link to comment Share on other sites More sharing options...
garydt Posted April 8, 2007 Author Share Posted April 8, 2007 I've changed the code to- mail("$To", "$Subject", "$Message", "From: $From" ); and i get error- Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for garydt88@tiscali.co.uk in C:\Program Files\xampp\htdocs\epeople\regcomplete.php on line 55 Does this mean the mail server at tiscali is rejecting it? What can i do to resolve it? Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted April 8, 2007 Share Posted April 8, 2007 um, im pretty certain that your server is rejecting it. are you using the right port i dont know if your using a host, contact them to ask what you can do. im not familiar with UK companies, is it an ISP offering an email or whats the case you whould try to simply send it from the local server. cant think of anyting else at the moment good luck Quote Link to comment Share on other sites More sharing options...
garydt Posted April 8, 2007 Author Share Posted April 8, 2007 Thanks, How do i send it from the local server? Quote Link to comment Share on other sites More sharing options...
garydt Posted April 8, 2007 Author Share Posted April 8, 2007 In the php.ini I put this- [mail function] ; For Win32 only. ;SMTP = smtp.tiscali.co.uk ;smtp_port = 25 ; For Win32 only. sendmail_from = $From sendmail_path = C:\Program Files\xampp\sendmail pop3_server= pop.tiscali.co.uk pop3_username= garydt88@tiscali.co.uk pop3_password= garytanner I'm still getting error- Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for garydt88@tiscali.co.uk in C:\Program Files\xampp\htdocs\epeople\regcomplete.php on line 55 Quote Link to comment Share on other sites More sharing options...
per1os Posted April 8, 2007 Share Posted April 8, 2007 Try setting the username to this: pop3_username= garydt88 and see what comes from it. Quote Link to comment Share on other sites More sharing options...
garydt Posted April 8, 2007 Author Share Posted April 8, 2007 Thanks. Tried that, still no joy. What else can i try? Quote Link to comment Share on other sites More sharing options...
garydt Posted April 8, 2007 Author Share Posted April 8, 2007 Can anyone help please? Quote Link to comment Share on other sites More sharing options...
garydt Posted April 8, 2007 Author Share Posted April 8, 2007 bump Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.