LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-20-2009, 10:28 AM   #1
Four
Member
 
Registered: Aug 2005
Posts: 298

Rep: Reputation: 30
sending mail in php to Israel mail servers


I have noticed that sending email using php doesn't work well to users with email accounts from servers in Israel (e.g. runbox.com). One fix was to change all "\r\n" to just "\n"; which worked but doesn't work for most sites like gmail accounts.

Is there a 1 fit all kinda thing way for emails to be properly parsed by all mail servers. The first header is properly parsed by Runbox accounts but using MIME boundaries are not parsed correctly unless all "\r" are removed (except for first header is fine)? But then that screws up gmail. Has anyone had similar problems?

Thank you.
 
Old 10-22-2009, 12:25 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
I wouldn't have thought you should be using '\r' at all, '\n' should be interpreted correctly per platform

cheers
 
Old 10-22-2009, 12:45 PM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,396

Rep: Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814
Quote:
Originally Posted by kbp
I wouldn't have thought you should be using '\r' at all, '\n' should be interpreted correctly per platform.

When communicating over the internet, you can't assume things like that.

See RFC 822, section 3.2
Quote:
field = field-name ":" [ field-body ] CRLF
If runbox.com doesn't work with \r\n, it has a bug; you'll have to work around it.
 
Old 10-22-2009, 06:39 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
What I was getting at was that on Windows '\n' becomes <cr><lf>, having an extra <cr> due to '\r' is not required

cheers
 
Old 10-23-2009, 10:37 AM   #5
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,396

Rep: Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814
That would only be the case when printing to the terminal or a file through a text-mode stream. The OP is about sending email, which means the data is going over a socket; usually neither side knows what platform the other is running, so things like line endings have to specified in the protocol.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending E-Mail From a Different Server Using PHP stevec Programming 6 08-02-2011 12:53 PM
can mail command be used to send mail onto global mail servers like yahoo etc dale_chip Linux - Newbie 4 08-12-2008 08:33 AM
PHP mail() sending as apache@ipaddress DukeLeto Linux - Software 1 04-13-2007 10:24 PM
Postfix mail transfer agent not sending mail locally or to other servers sketelsen Linux - Software 3 02-09-2006 11:16 AM
Sending mail with PHP and sendmail. davemar Linux - General 10 06-11-2004 04:48 PM


All times are GMT -5. The time now is 11:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration