Thread: sending message to GMAIL using SMTP

  1. #16
    Registered User
    Join Date
    Sep 2006
    Posts
    230
    Thanks. I guess I'll have to search google again (This is at least the twentieth time) but this time for how to handshake Gmail (or TLS).
    Thanks again.
    I might not be a pro, but I'm usually right

  2. #17
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Quote Originally Posted by Abda92 View Post
    Umm... I don't know what you mean by a local server.
    I meant you could install an SMTP server on your machine, and then connect to it with your program. That way, you could make sure that the server wasn't the problem.

  3. #18
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    The problem isnt with your code. Gmail, and most other email services block inbound port 25 traffic from dynamic IP's outside their local network. They do this to cut down on the spammers.

  4. #19
    Registered User
    Join Date
    Sep 2006
    Posts
    230
    Do you know any API I can use to send mail through SMTP?
    I searched Google a bit but all I found was shareware ones, and I can't pay $100 just for some libraries that I won't use more than once (I just program as a hobby)
    I might not be a pro, but I'm usually right

  5. #20
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Quote Originally Posted by abachler View Post
    The problem isnt with your code. Gmail, and most other email services block inbound port 25 traffic from dynamic IP's outside their local network. They do this to cut down on the spammers.
    smtp.gmail.com can be used from anywhere.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  6. #21
    Registered User
    Join Date
    Sep 2006
    Posts
    230
    Anyone know some libraries (preferably free) that can send mail using ESMTP (including the authentication)???
    I might not be a pro, but I'm usually right

  7. #22
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    I played with gmail a while back using java. The TLS was absolutely necessary to get things going.

    In java you could set the system property "mail.smtp.starttls.enable" to true. I do not know if there's a way to do something that easily in C++ or not, but it may be a good way to search for it.
    Last edited by Vicious; 03-26-2008 at 03:25 PM.
    What is C++?

  8. #23
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Well, you might find an SMTP library that makes it that easy, but neither Java nor C++ are magic.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  9. #24
    Registered User
    Join Date
    Jul 2008
    Posts
    1
    There does exist a libESMTP: http://www.stafford.uklinux.net/libesmtp/

    This library is used by esmtp, mutt, and a few other mailers. It can handle the TLS communications, but I haven't been able to get it working properly. In order to get the programs based on this lib to work with gmail, they say to get the signing certs from Thawte and put them in ~/.authenticate/ca.pem but still doesn't work for me.

    The library should do fine for straight-up SMTP relay though an open-relay server, or non-TLS auth servers....but who does that these days?

  10. #25
    Registered User
    Join Date
    Aug 2008
    Posts
    2
    Abda92 , please tell me, did you finally solved the problem with the TLS handshake ? what is the solution ?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strange string behavior
    By jcafaro10 in forum C Programming
    Replies: 2
    Last Post: 04-07-2009, 07:38 PM
  2. socket message sending and receiving problem
    By black in forum C Programming
    Replies: 5
    Last Post: 01-15-2007, 04:46 AM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  4. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 05:48 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM