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

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.

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>

unless you have defined the function called "Mail()" then you need to use "mail()" because function names are case sensitive.

I have changed "Mail" to "mail" and uploaded. I still receive the same error message.

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.

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

$headers = "From: "info@dating-advice-for-women.com\n";

this needs to be

$headers = "From: info@dating-advice-for-women.com\n";

It works now. Thank you soo much!

It works now. Thank you soo much!

Not a problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.