Hi, I tested to see if php mail is working for when I upload my site and after sending a text message I am still waiting to receive it is there a problem with the mail server or does it just not work full stop?
Thanks
Hi, I tested to see if php mail is working for when I upload my site and after sending a text message I am still waiting to receive it is there a problem with the mail server or does it just not work full stop?
Thanks
Hi, it was to both gmail and live... sample script is
thankPHP Code:<?php
// multiple recipients
$to = 'james@******.co.uk' . ', '; // note the comma
$to .= '******@hotmail.co.uk';
// subject
$subject = 'Birthday Reminders for August';
// message
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: James ***** <james@******.co.uk>' . "\r\n";
$headers .= 'From: JPO Legal Team <info@******.co.uk>' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
?>
You'll need to have text/plain as content-type for it to work, mail server silently eats the mail otherwise.
Do you have trouble reaching your site?
Check here first: News and Announcements
Don't forget that x10hosting has an irc server as well. Come and join the fun
server: irc.x10hosting.com, main channel: #x10hosting
There's a lot helpful users there if need help building your site
Hello,
I've spoken to one of our admins. Apparently, php mail only works if the type is set to text/plain. Also, there are known issues with sending to both gmail and windows live, as the free servers are often blacklisted due to past abuse. I know for a fact that in some cases, windows live won't even display a message sent from free. It doesn't even go into spam.
Ok I have changed the content type as advised, still getting problems though, included a little error catch in the code to see if it is actually working before being sent out...
Is there something wrong in this code or am I doing things correctly?PHP Code:<?php
// multiple recipients
$to = 'james@********' . ', '; // note the comma
$to .= '********@hotmail.co.uk';
// subject
$subject = 'Testing Email for site';
// message
$message = '
Test Email Message
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/plain; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: James *********l <james@********.co.uk>' . "\r\n";
$headers .= 'From: JPO Legal Team <info@********t.co.uk>' . "\r\n";
// Mail it
if (mail($to,$subject,$message,$headers) ) {
echo "email sent";
} else {
echo "email couldn't be sent";
};
?>
Thanks
Anyone???
The code works fine, I just copied it onto my test acct on the same server as you're on, and it sent nicely to gmail and my personal domain.
Most likely the emails would come to either spam bin, or in worst case silently be dropped by the recipients mail provider due to our servers being marked as sending spam (past abuse does cause a problem with some providers), if they aren't located in the inbox.
Do you have trouble reaching your site?
Check here first: News and Announcements
Don't forget that x10hosting has an irc server as well. Come and join the fun
server: irc.x10hosting.com, main channel: #x10hosting
There's a lot helpful users there if need help building your site
I have a similar problem, but the thing is I dont know much about php myself. Im using opencart and I cant seem to have any activation emails mailed out automatically. anything you guys can think of thatll help?
Need help with starting up your website? No problemo PM if you need help, if you want help with scripts like WordPress, SMF and so on dont be afraid to PM for that too.