Send Email From VB6

Hello,

How can I send a standard SMTP email message (no attachments) from a VB6 application?

Caveats
* Cannot use any third part solutions (ActiveX, DLLs etc.).  A native VB6 email function library would be OK though.
* Must be native to VB6.
* Must work on Windows 2003 servers and Windows XP.

I have scoured many Google listed sights and have not found anything that meets the about criteria yet.  
Perhaps I can use the MAPI controls, but I just need to send a simple email (not explicitly interfacing to an Exchange server).

I have a DOS tool that uses mailsend.exe from muquit.com.  It only requires the SMTP server IP and email address.  I was hoping for a native VB6 solution that would be this easy in VB6 too but not sure what the code would look like.


Thanks,

Michael
michael4606Asked:
Who is Participating?
 
d3nConnect With a Mentor Commented:
http://www.freevbcode.com/ShowCode.Asp?ID=109

Download the zip and use the classes of the vbSendMail in your own vb-app


0
 
Antagony1960Connect With a Mentor Commented:
0
 
Antagony1960Commented:
Ah, you beat me to it d3n.  :D
0
 
game-masterConnect With a Mentor Commented:

good morning!

try this...

goto PROJECT>REFERENCES>MICROSOFT CDO FOR WINDOWS 2000 LIBRARY


use this code...

sub sendEmail()
   Dim objCDO As New CDO.Message
   
    With objCDO
         .Subject = "Test"
         .From = "alvindoliente@yahoo.com"
         .To = "addoliente@findme.com.ph"
         .TextBody = "Hello alvin... this is a test message."
         .Send
    End With
end sub

i hope this will give u idea...
0
 
michael4606Author Commented:
All cool options.   Thanks guys.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.