using mail() from PHP script

Status
Not open for further replies.

simonp9940

New Member
Messages
3
Reaction score
0
Points
0
should this work ? on a free hosting account ?
Do I need to configure any thing ? Ive got a simple script which does not send email...



<?php
// The message
$message = "Line 1\nLine 2\nLine 3";

// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);
// Send
if (mail('srpsrp99@gmail.com', 'My Subject', $message)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}

echo "Result: $result $message<br>\n";

?>


PS. very new to this so go gentle ;-)
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
Hello,

mail() should be enabled and working, although in my own tests it has not been sending so I will ask an admin to take a look at the servers.
 
Status
Not open for further replies.
Top