Ram_Saw Posted March 14, 2014 Share Posted March 14, 2014 I'm searching for mail sender script. I heard about PEAR and mail(). But this ways don't approach me because PEAR it's already third-party environment and mails which were sent by mail() function often goes to the spam. I choosed sockets. I'd like to ask you: is it a good way or there are some better ways? So an example of its using I found: function socketmail($server, $to, $from, $subject, $message) { $connect = fsockopen ($server, 25, $errno, $errstr, 30); fputs($connect, "HELO localhost\r\n"); fputs($connect, "MAIL FROM: $from\n"); fputs($connect, "RCPT TO: $to\n"); fputs($connect, "DATA\r\n"); fputs($connect, "Content-Type: text/plain; charset=iso-8859-1\n"); fputs($connect, "To: $to\n"); fputs($connect, "Subject: $subject\n"); fputs($connect, "\n\n"); fputs($connect, stripslashes($message)." \r\n"); fputs($connect, ".\r\n"); fputs($connect, "RSET\r\n"); } But it doesn't work. I'm asking for your help. And idk what to write in $server, for example if it is Gmail? Quote Link to comment Share on other sites More sharing options...
.josh Posted March 14, 2014 Share Posted March 14, 2014 mail goes to spam because of things like improper headers, actual content of the email, and the reputation/history of the email server that's sending the email out. It has nothing to do with the mail function. Quote Link to comment Share on other sites More sharing options...
desjardins2010 Posted March 15, 2014 Share Posted March 15, 2014 hey josh regarding your comment above and considering I'm currently attempting to build myself a better mass mailer can you justify for me what is considered proper headers... I mean is there a cut rope method to ensure your emails get through - relevant of course to the content in the mail inself Quote Link to comment Share on other sites More sharing options...
.josh Posted March 15, 2014 Share Posted March 15, 2014 There is no cut rope guaranteed method to get your emails through. Even the most prominent businesses and domains out there tell you to check your spam/junk folder if you don't receive their email, and to explicitly mark their domain as "safe" or "not junk" in your settings. But, the spam assassin tests is a good place to start. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.