The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 23, 2019, 06:26:33 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: grrrr mail() not sending to some domains  (Read 3092 times)
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« on: November 21, 2007, 11:41:48 PM »

Not sure whats going on here, but one of my mail functions is not sending through to some domains.
Its weird since it seems to work on other servers.

Code:
$to = $_SESSION['email'];
$header = "From: info@example.com\nReply-To: info@example.com\nX-Mailer: PHP/" . phpversion();
$subject = "You Have Approved an Artwork";
$message = "This should work shouldnt it?";
               
mail($to,$subject,$message,$header);

Any ideas?
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: November 22, 2007, 12:05:24 PM »

I do not use that function, but I'm curious - does it try to SMTP directly to the recipients domain? If so, I've noticed in a lot of my spamming eblasting that certain ISPs (Cox is a huge one) will no longer accept email directly from a machiine, rather they require it through a DNS registered MX host for the sending domain... and the Microsoft SPF really helps as well.

So I guess what I'm saying is that it might well be a recipient problem rather than a sending code issue...
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« Reply #2 on: November 22, 2007, 02:47:42 PM »

This is what Im beginning to think perk.
Its strange one of the domains that isnt getting it, is setup on another hosting account, but with the same company that is hosting the sending email domain...

Since this simply wont do, If you dont mind me asking, what sort of thing do you use for sending mail from scripts perk?
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #3 on: November 22, 2007, 03:36:37 PM »

I use phpMailer - it's a nice mail class that can be used either as a direct-send or a forwarded emailer. I am away from home for several days, but I can post the code here if you want when I get back. Second, I set up a domain and MX and then use it to foward through rather than direct delivery anymore. The reason that I went direct delivery was speed - I could blow out a LOT of emails really quickly. Using a relay solution I go slower but get better delivery. So I am considering doing direct delivery first, and if I get the message that I can't deliver (phpMailer will tell me what the error was) THEN use my local MX as sort of a fallback position.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« Reply #4 on: November 23, 2007, 08:23:00 AM »

yeah that sounds like its a good call to make perky.
Its really getting on my nerves, with emails going astray and such.

If you could post the code Im sure not only myself but others would benefit. There is a massive grey area here when it comes from sending directly from php, very very unpredictable, sounds like what you are using works really well. Id love you to elaborate on the MX setup too, remember Im only beginning with this stuff.

Got a link to a read through?

cheers
d
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #5 on: November 26, 2007, 09:29:13 AM »

It would seem that the project has grown a bit since I grabbed the code... here is the current link:

http://phpmailer.codeworxtech.com/

a simple google of "phpmailer class" will give you more than enough. It's been a bread-and-butter class for me for a long time now.

/p
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« Reply #6 on: November 26, 2007, 06:25:59 PM »

Thanks mate, will give it a whirl.
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!