Jump to content

PHP Mail() not recieving by MSN


oconkero

Recommended Posts

I have a php mail script that lets users register and then it emails the username and pass along with an activation url but thats besides the point... i know it works on my shaw provided email and as well and gmail but not msn... doesnt even show up in junk... i have tried scripts and scripts but none work, well one did help me make the email show up and non-junk when recieved by shaw so im getting there but still nothing in msn... heres the just of the code.

$mailheaders = "From: $domain\n";
$mailheaders .= "Your account has been created.\n";
$mailheaders .= "Please activate your account now by visiting ...\n";
$mailheaders .= "\n";
$mailheaders .= "Username: $_POST[username]\n";
$mailheaders .= "Password: $_POST[password]";


$to = "$_POST[email]";
$subject = "Please activate your account";
$headers = "From: <$adminemail>\n";

mail($to, $subject, $mailheaders, $headers, "Reply-to: <$adminemail>");

Link to comment
Share on other sites

Mail headers need to have \r\n after not just \n and is only needed if there are multiple headers, the last line should not have \r\n

 

Either way, some email hosts choose to block mail sent by php. MSN is definitely one who at least filters them in a junk mailbox. There is no real way to get around it. My webhost is blocked by AOL, so I disallowed AOL email accounts on my site.

 

 

Link to comment
Share on other sites

Hi Oconkero!

 

I actually have the same problem with you and am looking for a solution.

 

Please read this thread by me before:

http://www.phpfreaks.com/forums/index.php/topic,131130.0.html

 

I have a script that send an email to myself. When the recipient's email was either hotmail / yahoo, they won't be able to receive the email. I tried to send to another email of mine (not hotmail / yahoo), and it worked like charm.

 

My assumption is either Yahoo and Hotmail has automatic delete on their server to prevent spammer.

 

But, my question is: how can we send an email, let's email verification / password reset, to our clients that are using hotmail / yahoo?

Link to comment
Share on other sites

Make sure when that the email is sent from someone that is an email that is valid, the way php is setup on my server it sends the email from admin@mydomain.com if you dont have it sent from someone Hotmail will not except it as incoming.  It is a configuration on some mail servers.

Link to comment
Share on other sites

I have tried to add the following header, but it still doesn't work. The email still won't send to my hotmail.

 

$headers = 'From: ' . $email . "\r\n" .

'Reply-To: ' . $email . "\r\n" .

'MIME-Version: 1.0' . "\r\n".

'Content-type: text/html; charset=iso-8859-1' . "\r\n" .

'X-Mailer: PHP/' . phpversion();

 

Can somebody help me out please?

 

Thanks a lot guys!!

Link to comment
Share on other sites

Yeah ive been trying and trying scripts what i think im gonn do because all the scripts out there a litteraly garbage to me cuz i nede one with md5 or better password hashes that uses mysql that is Not vuln to sql injections and uses email verification by sending an activation link... so im just gonna install phpbb2 on my site and rip the login and registration and config pages and then change the format a bit. first step) see if imsn recieves emails from ppl that register with phpbb forums. maybe you guys could fdo this too... after all i know that phpbb is really really secure, it blockes sql injections for one. :P

 

thanks for all your help guys and girls :D

Link to comment
Share on other sites

Update: well i verified that phpbb3 beta 5 i think is not vuln to sql injections and it uses md5 password hashes with mysql... but sadly still no msn emails recieved. :( but i noticed if you copy the url after logging in it has the ?sid=dsguidfghusidghluahsufaishg <- random but you can open another window or IE and copy and paste, bam logged in... doesnt seam that secure to me ill take a look at phpBB2 see if it has the same vulnerability

 

Update: hmm yes it seams to me after loggin in on phpBB3 b5 it create a sid varible and if some1 gets it while your logged in the too can use your account, but a new one is generated every time you login...

Link to comment
Share on other sites

Hi!

 

Yeah, oconkero, please try to paste the url to another browser, like firefox. Or better yet, try to paste it to another computer, I don't think it will work. The SID probably related to the cookies stored in your machine. Plus, PHPbb3 is still beta. They may fix this problem once they have released the final version.

 

This email things can never work around MSN. I have tried many many headers, read other threads and they all say the same thing, can't get it work with MSN. I think we shaunrigby was right. But, if we need to register our mail server with MS's 'safe list', I assume that would take long time.

 

We, on the other hand, can't block anybody with hotmail account from our website. We know that hotmail users are so many. I am one of them.

 

Thanks guys!!!

Link to comment
Share on other sites

The MSN junk mail filter is systematic, follow thie link , https://postmaster.live.com/snds/addnetwork.aspx, and add your SMTP server IP address, if you use more than 1 enter the range. FAQ for the service can be found here; https://postmaster.live.com/snds/FAQ.aspx

 

i am pretty sure that this is the answer, i have this problem, and because i do not have a dedicated server i am unable to do it because my smtp server is shared, and according to my web host ihave to supply my own SMTP server, good news is tho there are many free smtp severs out there

Link to comment
Share on other sites

Hi Shaunrigby,

 

I am also using shared hosting which I thought would not be able to add to MS server.

 

Why can't we add the shared SMTP server, does the MS Server disallow this?

 

 

I do a quick search on google for FREE SMTP Server. The results are software that will send an email using our machine's smtp instead of our ISP's SMTP Server. This is typically used by travelers that can't really use their ISP's SMTP Server when they go travel. I don't think this kind of software is what we are after here. This kind of software only use our machine as SMTP server, and I don't think we can install it in to our shared hosting.

If you have GMAIL account, you can actually use google SMTP server to send email out. Use smtp.google.com, but you have to provide your gmail account and password.

 

The question here is, how can we use our own SMTP Server in shared hosting server?

 

Thanks guys!!!

Link to comment
Share on other sites

Here's the link for those who need ini_set() function description:

http://www.php.net/manual/en/function.ini-set.php

 

So, the idea is to change the SMTP server setting in PHP.ini. What variable name do I need to change?

 

On the description of ini_set(), it says that the original value will be restored automatically at the end of the script. So, what I have in mind is to change the value everytime we need to send out a mail. Then, it will be changed back later on. Do you have any idea?

 

Thanks shaunrigby!

Link to comment
Share on other sites

No, not yet. I also believe that that is the best way to go.

 

Like I said earlier, I also use shared hosting. If I add it to SNDS Network, I think the whole shared hosting will be in the safe list. I don't know.

 

Are we not be able to add our SMTP server to SNDS Network if we have shared hosting?

Link to comment
Share on other sites

Yes, I agree with it. Many of the PHP coders have problem with sending email to MSN Hotmail users. I tried to search the topic about mail() and MSN Hotmail in this forum, but there is no real solution to each of the thread I read. So, it will be great if we can make this sticky.

 

I go briefly on SNDS FAQ, and I realize that they have very tight and strict security to prevent spam, malware and virus send by emails. That's why they have SNDS. It's really useful and effective way to prevent such things, but it's a hassle for coders to work around with them.

Link to comment
Share on other sites

No, I haven't submitted my application yet.

 

I was asking you did you receive any error message since you said that you were unable to add your SMTP server to SNDS network because you have shared SMTP Server. So, did you receive it any error message, or have you not tried it yet?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.