| | |
Mail() returning parse error
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2008
Posts: 5
Reputation:
Solved Threads: 0
Code:
[<?php
Mail(“info@dating-advice-for-women.com”, “This is the message subject”, “This is the message body”);
?>]
Error message:
"Parse error: syntax error, unexpected '@' in /home/dating8/public_html/newland/messagesent.php on line 2"
The server is SMTP email-enabled and the folder on the server has permission to send SMTPmail messages.
The hosting company reply:
"Please ensure your scipt has the SMTP information specifically in it so it is passing the properly directives. Any scripts executing on the server should be permissions of 755 as should the directory they are located in generally."
My question:
How do I include the SMTP specifically in the script?
Thank you.
Br,
Christian
[<?php
Mail(“info@dating-advice-for-women.com”, “This is the message subject”, “This is the message body”);
?>]
Error message:
"Parse error: syntax error, unexpected '@' in /home/dating8/public_html/newland/messagesent.php on line 2"
The server is SMTP email-enabled and the folder on the server has permission to send SMTPmail messages.
The hosting company reply:
"Please ensure your scipt has the SMTP information specifically in it so it is passing the properly directives. Any scripts executing on the server should be permissions of 755 as should the directory they are located in generally."
My question:
How do I include the SMTP specifically in the script?
Thank you.
Br,
Christian
•
•
•
•
Code:
[<?php
Mail(“info@dating-advice-for-women.com”, “This is the message subject”, “This is the message body”);
?>]
Error message:
"Parse error: syntax error, unexpected '@' in /home/dating8/public_html/newland/messagesent.php on line 2"
The server is SMTP email-enabled and the folder on the server has permission to send SMTPmail messages.
The hosting company reply:
"Please ensure your scipt has the SMTP information specifically in it so it is passing the properly directives. Any scripts executing on the server should be permissions of 755 as should the directory they are located in generally."
My question:
How do I include the SMTP specifically in the script?
Thank you.
Br,
Christian
Last edited by R0bb0b; Oct 2nd, 2008 at 11:32 am.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
•
•
Join Date: Oct 2008
Posts: 5
Reputation:
Solved Threads: 0
Here is the entire code for messagesent.php:
[<?php
Mail(“info@dating-advice-for-women.com”, “This is the message subject”, “This is the message body”);
?>]
<!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>
<title>Newland Tours: About</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/newland.css" rel="stylesheet" type="text/css" /></head>
<body>
<a href="#top"><img src="images/spacer.gif" alt="Skip to main page content" width="1" height="1" border="0" align="left" /></a>
<table width="750" border="0" cellpadding="3" cellspacing="0">
<tr>
<td><img src="images/banner_left.gif" width="451" height="68" alt="Newland Tours Banner, Left." /></td>
<td width="280"><img src="images/banner_right.jpg" width="276" height="68" alt="Newland Tour Banner, Right." /></td>
</tr>
<tr>
<td><img src="images/navbar.gif" name="navbar" width="450" height="20" border="0" usemap="#navbarMap" alt="Navigation Bar." /></td>
<td><img name="copyright_bar" src="images/copyright_bar.gif" width="272" height="20" border="0" alt="Copyright 2006 Newland Tours." /></td>
</tr>
<tr>
<td colspan="2">
<h1><br />
<a name="top" id="top"></a>Message Sent </h1>
<p>Your message has been sent. You should hear from us within two days. </p>
<p>Return to Newland <a href="index.php">home</a>. </p></td>
</tr>
</table>
<br />
<map name="navbarMap" id="navbarMap">
<area shape="rect" coords="1,0,62,20" href="index.php" alt="Home" />
<area shape="rect" coords="71,0,117,20" href="about.php" alt="About" />
<area shape="rect" coords="129,0,196,20" href="tours.php" alt="Find Tours" />
<area shape="rect" coords="209,0,311,20" href="profiles.php" alt="Country Profiles" />
<area shape="rect" coords="327,0,434,20" href="contact.php" alt="Contact An Agent" />
</map>
</body>
</html>
[<?php
Mail(“info@dating-advice-for-women.com”, “This is the message subject”, “This is the message body”);
?>]
<!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>
<title>Newland Tours: About</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/newland.css" rel="stylesheet" type="text/css" /></head>
<body>
<a href="#top"><img src="images/spacer.gif" alt="Skip to main page content" width="1" height="1" border="0" align="left" /></a>
<table width="750" border="0" cellpadding="3" cellspacing="0">
<tr>
<td><img src="images/banner_left.gif" width="451" height="68" alt="Newland Tours Banner, Left." /></td>
<td width="280"><img src="images/banner_right.jpg" width="276" height="68" alt="Newland Tour Banner, Right." /></td>
</tr>
<tr>
<td><img src="images/navbar.gif" name="navbar" width="450" height="20" border="0" usemap="#navbarMap" alt="Navigation Bar." /></td>
<td><img name="copyright_bar" src="images/copyright_bar.gif" width="272" height="20" border="0" alt="Copyright 2006 Newland Tours." /></td>
</tr>
<tr>
<td colspan="2">
<h1><br />
<a name="top" id="top"></a>Message Sent </h1>
<p>Your message has been sent. You should hear from us within two days. </p>
<p>Return to Newland <a href="index.php">home</a>. </p></td>
</tr>
</table>
<br />
<map name="navbarMap" id="navbarMap">
<area shape="rect" coords="1,0,62,20" href="index.php" alt="Home" />
<area shape="rect" coords="71,0,117,20" href="about.php" alt="About" />
<area shape="rect" coords="129,0,196,20" href="tours.php" alt="Find Tours" />
<area shape="rect" coords="209,0,311,20" href="profiles.php" alt="Country Profiles" />
<area shape="rect" coords="327,0,434,20" href="contact.php" alt="Contact An Agent" />
</map>
</body>
</html>
unless you have defined the function called "Mail()" then you need to use "mail()" because function names are case sensitive.
Last edited by R0bb0b; Oct 2nd, 2008 at 12:11 pm.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
•
•
Join Date: Oct 2008
Posts: 5
Reputation:
Solved Threads: 0
I have now written it like this instead:
<?php
$to = "info@dating-advice-for-women.com";
$subject = "subject";
$body = "body";
$headers = "From: "info@dating-advice-for-women.com\n";
mail($to,$subject,$body,$headers);
?>
I now reive this error instead:
Parse error: syntax error, unexpected T_STRING in /home/dating8/public_html/newland/messagesent.php on line 5
I read somewhere else that it means there is one to many spaces. I will check it out.
I will credit you.
Thank you so much.
<?php
$to = "info@dating-advice-for-women.com";
$subject = "subject";
$body = "body";
$headers = "From: "info@dating-advice-for-women.com\n";
mail($to,$subject,$body,$headers);
?>
I now reive this error instead:
Parse error: syntax error, unexpected T_STRING in /home/dating8/public_html/newland/messagesent.php on line 5
I read somewhere else that it means there is one to many spaces. I will check it out.
I will credit you.
Thank you so much.
•
•
•
•
I have now written it like this instead:
<?php
$to = "info@dating-advice-for-women.com";
$subject = "subject";
$body = "body";
$headers = "From: "info@dating-advice-for-women.com\n";
mail($to,$subject,$body,$headers);
?>
I now reive this error instead:
Parse error: syntax error, unexpected T_STRING in /home/dating8/public_html/newland/messagesent.php on line 5
I read somewhere else that it means there is one to many spaces. I will check it out.
I will credit you.
Thank you so much.
php Syntax (Toggle Plain Text)
$headers = "From: "info@dating-advice-for-women.com\n";
this needs to be
php Syntax (Toggle Plain Text)
$headers = "From: info@dating-advice-for-women.com\n";
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
![]() |
Other Threads in the PHP Forum
- Previous Thread: Problems with my Login
- Next Thread: <<PHP Parse Error>> Please help
| Thread Tools | Search this Thread |
ajax apache api array basics beginner binary broken cakephp checkbox class cms code codingproblem combobox cron curl database date display domain dynamic echo email error file files folder form format forms function functions google href htaccess html image include insert interactive ip java javascript joomla js limit link load login mail malfunctioning menu mlm mobile multiple mysql nodes oop outofmemmory paging parse paypal pdf php problem procedure query radio ram random recursion reference remote return script search server sessions sms source space sql syntax system table tutorial unset up-to-date update upload url validation validator variable video web webapplications websitecontactform youtube





