Results 1 to 8 of 8

Thread: Send SMTP Mail via VB6

  1. #1

    Thread Starter
    Hyperactive Member rockies1's Avatar
    Join Date
    Jul 1999
    Location
    Stuck at work
    Posts
    375

    Send SMTP Mail via VB6

    We have an SMTP server here at work and I need to be able to send mail thru it.

    Anyone have some simple code that works without having to register dll's?

    I can't find any examples that 1) work or 2) don't make me register a DLL.

    Thanks!!
    Morgan
    [email protected] - Home
    [email protected] - Work
    Using VB6 SP6 but trying to learn VB2005EE

  2. #2
    Let me in .. techyspecy's Avatar
    Join Date
    Aug 2002
    Location
    Back to VBF.
    Posts
    2,456
    If you have Microsoft CDONTS library installed ... you can use this code. This is as simple as you're going to get.

    VB Code:
    1. Set objMail = CreateObject("CDONTS.NewMail")
    2. objMail.From = strEmail
    3. objMail.To = strEmailTo
    4. objMail.Subject = strSource
    5. objMail.Body = strContents
    6. objMail.Send
    7. Set objMail = Nothing

  3. #3
    Hyperactive Member
    Join Date
    May 2003
    Posts
    401

    Re: Send SMTP Mail via VB6

    Originally posted by rockies1
    We have an SMTP server here at work and I need to be able to send mail thru it.

    Anyone have some simple code that works without having to register dll's?

    I can't find any examples that 1) work or 2) don't make me register a DLL.

    Thanks!!
    You can try this option:

    You can use OstroSoft SMTP component. Open file for input, read it into string variable, set SMTP.MessageBody equal to this variable and send it.

    Also look into this URL for more info:

    http://www.ostrosoft.com/smtp_component.asp

    And this as well:
    http://www.asp101.com/articles/john/cdosmtprelay/default.asp

    Enjoy!!!!
    apps_tech

  4. #4

    Thread Starter
    Hyperactive Member rockies1's Avatar
    Join Date
    Jul 1999
    Location
    Stuck at work
    Posts
    375
    OstroSoft requires registering a dll...
    Morgan
    [email protected] - Home
    [email protected] - Work
    Using VB6 SP6 but trying to learn VB2005EE

  5. #5
    Hyperactive Member
    Join Date
    May 2003
    Posts
    401
    Originally posted by rockies1
    OstroSoft requires registering a dll...
    Well then, u might try what techspacey has mentioned. It should work!!!!

    Enjoy!!!
    apps_tech

  6. #6

    Thread Starter
    Hyperactive Member rockies1's Avatar
    Join Date
    Jul 1999
    Location
    Stuck at work
    Posts
    375
    Originally posted by techyspecy
    If you have Microsoft CDONTS library installed ... you can use this code. This is as simple as you're going to get.
    How do I tell?

    I tried setting a reference to Microsoft CDO for NTS 1.2 Library, but I get
    Code:
    ? err.Number
     429 
    ? err.Description
    ActiveX component can't create object
    Morgan
    [email protected] - Home
    [email protected] - Work
    Using VB6 SP6 but trying to learn VB2005EE

  7. #7
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    I believe this should cover your needs.


    Has someone helped you? Then you can Rate their helpful post.

  8. #8

    Thread Starter
    Hyperactive Member rockies1's Avatar
    Join Date
    Jul 1999
    Location
    Stuck at work
    Posts
    375

    Talking

    I found this and it worked!

    http://winsockvb.com/article.php?article_id=20&page=1

    Thanks for all the help & pointers!!
    Morgan
    [email protected] - Home
    [email protected] - Work
    Using VB6 SP6 but trying to learn VB2005EE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width