954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Mail() returning parse error

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

Maverick2608
Newbie Poster
5 posts since Oct 2008
Reputation Points: 10
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

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.

R0bb0b
Posting Shark
998 posts since Jun 2008
Reputation Points: 358
Solved Threads: 89
 

Skip to main page content Newland Tours Banner, Left.Newland Tour Banner, Right.Navigation Bar.Copyright 2006 Newland Tours.
Message Sent Your message has been sent. You should hear from us within two days.

Return to Newland home.




Maverick2608
Newbie Poster
5 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

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

R0bb0b
Posting Shark
998 posts since Jun 2008
Reputation Points: 358
Solved Threads: 89
 

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

Maverick2608
Newbie Poster
5 posts since Oct 2008
Reputation Points: 10
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.

Maverick2608
Newbie Poster
5 posts since Oct 2008
Reputation Points: 10
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.


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";
R0bb0b
Posting Shark
998 posts since Jun 2008
Reputation Points: 358
Solved Threads: 89
 

It works now. Thank you soo much!

Maverick2608
Newbie Poster
5 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 
It works now. Thank you soo much!


Not a problem.

R0bb0b
Posting Shark
998 posts since Jun 2008
Reputation Points: 358
Solved Threads: 89
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You