Sending mail with Gmail’s SMTP server with fsockopen

13 thoughts on “Sending mail with Gmail’s SMTP server with fsockopen”

  1. Thanks for sharing this. Just what i was looking for. I cant get mail function working on my web host provider (spam filters), so i will try this method. I have tried via Telnet, but gmail – smtp disconnected me after a few seconds 🙂

  2. Amazing code, thank you! I’m using CodeIgniter and its Email class wasn’t able to use Gmail’s SMTP, but your code works beautifully.

  3. Dear,

    Its working. But there is a small issue i.e. i have set

    $user = ‘Gmail User ID’;
    and
    fwrite($socket, ‘MAIL FROM: ‘.”\r\n”);

    But when i run this code, it emails but from email address is my $user not My other Email Address. Is it possible that the from Email Address is anything different from $user which i mention??? Waiting for your reply.

  4. Greate pieces. Keep writing such kind of information on your
    blog. Im really impressed by it.
    Hey there, You’ve performed a fantastic job. I’ll definitely digg it and in my view suggest to my
    friends. I’m confident they’ll be benefited from this site.

  5. Great job !
    It works fine for me except my email still in junk folder :/
    Anyway thank you for sharing !

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.