Jump to content

Best mail sender script


Ram_Saw

Recommended Posts

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?

Link to comment
Share on other sites

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 

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.