Mail() returning parse error

Reply

Join Date: Oct 2008
Posts: 5
Reputation: Maverick2608 is an unknown quantity at this point 
Solved Threads: 0
Maverick2608 Maverick2608 is offline Offline
Newbie Poster

Mail() returning parse error

 
0
  #1
Oct 2nd, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Mail() returning parse error

 
0
  #2
Oct 2nd, 2008
Originally Posted by Maverick2608 View Post
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
This has nothing to do with file permissions or that line of code that you have posted. The error is at messagesent.php around line 2. It is as simple as that. Post your code from messagesent.php.
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 5
Reputation: Maverick2608 is an unknown quantity at this point 
Solved Threads: 0
Maverick2608 Maverick2608 is offline Offline
Newbie Poster

Re: Mail() returning parse error

 
0
  #3
Oct 2nd, 2008
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>
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Mail() returning parse error

 
0
  #4
Oct 2nd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 5
Reputation: Maverick2608 is an unknown quantity at this point 
Solved Threads: 0
Maverick2608 Maverick2608 is offline Offline
Newbie Poster

Re: Mail() returning parse error

 
0
  #5
Oct 2nd, 2008
I have changed "Mail" to "mail" and uploaded. I still receive the same error message.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 5
Reputation: Maverick2608 is an unknown quantity at this point 
Solved Threads: 0
Maverick2608 Maverick2608 is offline Offline
Newbie Poster

Re: Mail() returning parse error

 
0
  #6
Oct 2nd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Mail() returning parse error

 
0
  #7
Oct 2nd, 2008
Originally Posted by Maverick2608 View Post
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.
the error is here
  1. $headers = "From: "info@dating-advice-for-women.com\n";
  2.  

this needs to be
  1. $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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 5
Reputation: Maverick2608 is an unknown quantity at this point 
Solved Threads: 0
Maverick2608 Maverick2608 is offline Offline
Newbie Poster

Re: Mail() returning parse error

 
0
  #8
Oct 2nd, 2008
It works now. Thank you soo much!
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Mail() returning parse error

 
0
  #9
Oct 2nd, 2008
Originally Posted by Maverick2608 View Post
It works now. Thank you soo much!
Not a problem.
“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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC