DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Mar 2005
    Posts
    67

    SMTP with SSL support

    Hi Everyone,

    I would like to know if there is available any piece of code to send SMTP emails with SSL/TSL support. I've been using the vbSendmail.dll works great but does not have SSL support.

    Thanks

    FededS

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,651
    Does this help?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Mar 2005
    Posts
    67
    Hi Hack, thanks for your reply. The code provided belongs to a Shareware component, what I was looking for is some SMTP vb code with SSL support. If I can find it in plain C or C++ would also help. I have searched all the web without any examples (there are some couple of examples in the web using MFC but would like a non MFC example)

    Thanks!

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,651
    Quote Originally Posted by FededS
    If I can find it in plain C or C++ would also help.
    Then I will move it here so our resident C++ guru (a.ka. Danny) will be sure to see it.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  5. #5
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    I remember I have found once ago a vb project using a dll called "Auth.dll" for the TLS ... for the SSL you can use the transfere control found with vb6+

    unfortunatly I don't know where is this project found now (commercial projects come first before free open sources in search results...)

    however if you want the method of implementing such algorithm you can take a look at the source of "FileZilla" ... otherwise you may use direct windows APIs ...
    finally i don't know maybe this library can helps too :
    http://sourceforge.net/projects/tlslite/

    **for the vb project i think i have a copy in my home pc, i will look for it when i return back, i so I'll share it here or at least point to the website link (unless you can find it in google ...)
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  6. #6
    Join Date
    Nov 2003
    Posts
    4,118
    You can also try to look for free code on www.sourceforge.org
    Danny Kalev

  7. #7
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    well for the "auth.dll" and how to use it in your project:
    http://gnuwin32.sourceforge.net/packages/openssl.htm



    a professional example:
    http://www.rtfm.com/openssl-examples/

    a complete -dll independent- vb project [and it's very rare] :
    http://www.planet-source-code.com/vb...43694&lngWId=1

    But you have to read the comments there because the code has too many bugs as i remember .. if so it will be kind from you if you share a better code and tell us about it ..
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  8. #8
    Join Date
    Mar 2005
    Posts
    67
    Amahdy and Danny, thanks so much for your help and links, there are lots of examples and will find my way also looking at some sourceforge projects. Thansk!

  9. #9
    Join Date
    Mar 2008
    Posts
    7
    FededS did you come up with a solution for yourself? if so would you mind sharing it? I have been searching (in vain) for days. STARTTLS error is my currentl problem

    Read the OPENSSL site, but havent had proper time yet

  10. #10
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,651
    What is the error and what code do you have that is causing it?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  11. #11
    Join Date
    Mar 2008
    Posts
    7
    Quote Originally Posted by Hack
    What is the error and what code do you have that is causing it?
    I have been using a variety of things, but vbsendmail was one of them

    then i looked at the code from the sourceforge link, but couldnt figure out how that could help me, despite the fact that it seemed to use SSL and client/server stuff.

    Late last night I found some code on another forum that made it work though, but its a different solution:

    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

    'Name or IP of Remote SMTP Server
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.your.com"

    'Type of authentication, NONE, Basic (Base64 encoded), NTLM
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

    'Your UserID on the SMTP server
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "youruserid"

    'Your password on the SMTP server
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword"

    'Server port (typically 25)
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

    'Use SSL for the connection (False or True)
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

    'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

    objMessage.Configuration.Fields.Update

    '==End remote SMTP server configuration section==

    objMessage.Send
    It uses CDO obviously but my only concern is the security of my email, password etc. Any comments on this code OR how I can make the sourceforge code work for me?

  12. #12
    Join Date
    Mar 2008
    Posts
    7
    I tried to use the sourceforge code someone posted above, but i couldnt see the link of how I would use it to set up the SSL security. I know its using SSL but I just couldnt figure out how it would work. Any suggestions?

    Then I tried using vbSendMail, but it doesnt support SSL. Is there anything from the sourceforge code that could be merged with the vbSendMail to make it work for SSL?

    then last night, i found some code on vbforums that got it done for me using CDO technique, but my concern is, it routes the mail through a server called schema.microsoft.com. It sends the p/w and user name info (apparently) unencrypted. Any comments on that code?
    Last edited by vbrook; 03-29-2008 at 07:40 AM.

  13. #13
    Join Date
    Mar 2008
    Posts
    7
    forgot the code:

    '==This section provides the configuration information for the remote SMTP server.

    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

    'Name or IP of Remote SMTP Server
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.your.com"

    'Type of authentication, NONE, Basic (Base64 encoded), NTLM
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

    'Your UserID on the SMTP server
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "youruserid"

    'Your password on the SMTP server
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword"

    'Server port (typically 25)
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

    'Use SSL for the connection (False or True)
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

    'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

    objMessage.Configuration.Fields.Update

    '==End remote SMTP server configuration section==

    objMessage.Send

  14. #14
    Join Date
    Nov 2003
    Posts
    4,118
    I would also look at sourceforge.org and see if they have Open Source libraries for that. They should.
    Danny Kalev

  15. #15
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    vbrook; first here is c++ section so it could be better to find answers if you post in VB section unless it doesn't matter and you kan have the examples in c++ ...

    second take a look at my links in post #7 .. there is pretty library for c++ and vb and there is also a complete vb example ... what seems you need at the end is just the SSL installed in the server ... have you did that already ? so what's your problem exactly so far ?
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

Similar Threads

  1. API Support Manager - Microsoft adCenter
    By jubalince in forum Careers
    Replies: 0
    Last Post: 03-13-2007, 07:36 PM
  2. Replies: 0
    Last Post: 06-08-2006, 02:30 PM
  3. Java Mail Error
    By ddsuresh in forum Java
    Replies: 1
    Last Post: 12-29-2005, 09:58 AM
  4. Detect SSL Browser Support
    By d'man in forum ASP.NET
    Replies: 0
    Last Post: 06-10-2002, 10:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links