Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbSendMail download

Status
Not open for further replies.

DaveMere

Programmer
Nov 24, 2003
20
GB
Hi all.

Is anyone familiar with sending email from VB applications using the vbSendMail download? I've downloaded the program and it works fine when running independantly. What I'd like to do though is to send an email automatically from an application of mine when a certain function is successfully completed. How can I do this? Should I add the bas/frm files from vbSendMail to my own application, or somehow call the vbSendMail .exe and let it do the work? Or what?

Cheers,

DaveMere
 
Thanks Dimandja, but I'm afraid I still can't get this to work.

I copy the code from that link into my application; but what do I do with the actual vbSendMail exe that I downloaded? How does my application use the vbSendMail code?

Cheers,

DaveMere
 
If you download the .zip file from the above mentioned link it has sample projects and the SendMail.dll along with detail documentation on it's use. You do not need any SendMail.exe as your using the SendMail.dll with your app.
 
The vbSendMail.exe is just an example program on how to use the DLL.

After you have registered the DLL on your machine, in the IDE for your program, under Project/References, set the reference to the DLL. ( It's listed as "SMTP Send Mail for VB6.0" )

In your programs declaration section, set a variable to the DLL.

Code:
Private WithEvents poSendMail As vbSendMail.clsSendMail

Place a subroutine in your program, similar to this:

Code:
Public Sub MailThis(NotifyAddress As String, MySubject as String, MyMessage as String, MyName as String)

Set poSendMail = New clsSendMail

poSendMail.SMTPHost = "192.168.0.210" ' set your own SMTP host here, this one just happens to be ours here.
poSendMail.From = "MyName@Myaddress.com"
poSendMail.FromDisplayName = MyName
poSendMail.Recipient = NotifyAddress
poSendMail.RecipientDisplayName = NotifyAddress
poSendMail.Subject = MySubject
poSendMail.Message = MyMessage
poSendMail.Send

End Sub

Then, when you want to send a mail, just call the sub with the appropriate values.

Just the basics, but it works fine for me.

Robert
 
It all works fine now.

Thanks to you all - this was of great help.

DaveMere
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top