Unable to send to Hotmail using mail()

Status
Not open for further replies.

ViperBlade

New Member
Messages
186
Reaction score
0
Points
0
Hey there. I'm currently unable to send E-mail to hotmail, however if I send to a mailinator address, it receives. Are there any specific headers I need to send email with?

I'm currently using this function I've hased together myself:
PHP:
function email($to, $subject, $plain, $html)
	{
	$semi_rand = md5(time());
	$mime_boundary = "==MULTIPART_BOUNDARY_$semi_rand";
	$mime_boundary_header = chr(34) . $mime_boundary . chr(34);

	$from = "turnip@pervhunter.x10.mx";
	$body = "This is a multi-part message in MIME format.

--$mime_boundary
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

$plain

--$mime_boundary
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

$html

--$mime_boundary--";
	if (@mail($to, $subject, $body, 
	"From: " . $from . "\n" . 
	"Return-Path: " . $from . "\n" .
	"Reply-To: " . $from . "\n" .
	"To: " . $to . "\n" .
	"Sent: " . date("jS F Y, g:i a") . "\n" .
	"Sender: " . "x10hosting.com" . "\n" .
	"X-Priority: 1\n" .
	"X-MSMail-Priority: High\n" .
    "X-Mailer: PHP/" . phpversion() . "\n" .
	"MIME-Version: 1.0\n" . 
	"Content-Type: multipart/alternative;\n" . 
	"	boundary=" . $mime_boundary_header))
		{
		return true;
		}
	else
		{
		return false;
		}
	}

I used to be able to send to hotmail with an x10hosting account a couple of years ago with the following headers set.
PHP:
mail($email_address, $subject, $message, "X-Mailer: PHP/" . phpversion() . "
X-SID-PRA: alerts@pervgallery.co.nr
From: alerts@pervgallery.co.nr
Return-Path: alerts@pervgallery.co.nr")

Has sending to hotmail been taking away now?

Thanks for reading
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
If memory serves hotmail and yahoo currently have us blacklisted; that wasn't done by choice on our part though. Despite all of our work trying to stop the spammers, they're still getting through occasionally, and since a lot of folks use hotmail and yahoo, they're the first to receive all the spam.

We've already tried contacting them to resolve it; so far no dice :(
 

ViperBlade

New Member
Messages
186
Reaction score
0
Points
0
First off: Amazing signature, lol

Secondly, does this apply for paid hosting as well?
Oddly enough I Hotmail receives from the webmail client in cpanel, so it being an x10 blacklisting doesn't quite make sense.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
The workaround is

1. Set up a Google Apps account for your domain
2. Set your mail settings to Google Apps (following the instructions on Google).
3. Use PHPMailer or similar script to send the mail via SMTP through your Google Apps account.
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
First off, thanks :) Gotta love counting my suspensions :)

Secondly, I'm not sure if it's blocked on paid or not; post the hotmail address you're using for testing and I can send one from my paid account to test though. The weird part is if it's getting it via the webmail client just fine, then why is it blocking it through mail...

In any case descalzo's got the alternative - since gmail isn't blocked by us or by hotmail, you can utilize their email sending system instead :)
 

ViperBlade

New Member
Messages
186
Reaction score
0
Points
0
Cool, thanks.
My e-mail is <removed for privacy now that test is done>


Edited by Livewire: Removed the email once I did the test so it remains private :)
 
Last edited by a moderator:

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Test sent from a test file on my account (not through webmail). Lemme know if it works :)
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Probably cause I didn't actually use appropriate headers and it did look a bit spammy XD
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
From'll have to be different cause it's coming from the wrong server, but yeah hang on.
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Took a bit cause I had to fill in the message and stuff, but sent. See what happened :)



Edit: Noticed it didn't send quite right on my end - it used the second batch of code, not the actual function cause I dun have an html page to use XD Lemme know what it did anyways, I can send a third if needbe.
 
Last edited:

ViperBlade

New Member
Messages
186
Reaction score
0
Points
0
Went through to spam.

Perhaps give this one a go
PHP:
$to = "myemail";
$from = "youremail";
$subject = "test";
$body = "Did <B>this</B> one work?";

mail($to, $subject, $body, 
"From: " . $from . "\n" . 
"Return-Path: " . $from . "\n" .
"Reply-To: " . $from . "\n" .
"To: " . $to . "\n" .
"Sent: " . date("jS F Y, g:i a") . "\n" .
"Sender: " . "x10hosting.com" . "\n" .
"X-Priority: 1\n" .
"X-MSMail-Priority: High\n" .
"X-Mailer: PHP/" . phpversion() . "\n" .
"MIME-Version: 1.0\n" .
"Content-type: text/html; charset=iso-8859-1");

Edit: Thanks for doing this btw.
 
Last edited:

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Reran with new code, and no problem - I'd rather make sure it works -before- having you jump to paid to find out it doesn't XD

My guess though is it might just be binning it not because of headers, but because it -does- look semi spammy. The upshot? If it's binning it, it's not blacklisted. Blacklisted means it doesn't even show up :)
 

ViperBlade

New Member
Messages
186
Reaction score
0
Points
0
Came through to junk. Never mind though, I appreciate you trying.
I'm going to run the same code on my free hosting and attempt to send to your from address. Let me know if you receive anything.

EDIT: Message sent.
 
Last edited:

ViperBlade

New Member
Messages
186
Reaction score
0
Points
0
Got 4!? Ah well... Just tried sending one to myself and nothing came through, so I'll go ahead and assume it won't work for free, but will for paid with a few tweaks.

The reason I'm so sure it's a header issue is that when I had hosting here a few years ago, using mail() without adding headers made e-mail go to junk, and adding headers made it go to inbox.

Thanks for all your help livewire.
May as well mark this as closed.
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Closing at request; if you need more help, let us know :)
 
Status
Not open for further replies.
Top