Click to See Complete Forum and Search --> : send emails


catgirl78
March 17th, 2001, 02:27 PM
I am doing a VB application and is linking to MS Access 97.
this program allow the user to enter their details and email address.
how do i extract the email address from the database and automatically send a confirmation email to the user in VB....

please help!!!
any help is greatly appreciate...
thanks

Robert Moy
March 17th, 2001, 05:39 PM
Try this. call Mapisession from VB. To get to mapisession use Project|Component and then checkoff Miscrosoft MAPI Component. Then type Mapisession1.
Try to link them together.

Good Luck

coolbiz
March 18th, 2001, 12:02 AM
This pretty much depends on what type email system do you have. But if you have MS Outlook installed and configured to send email on the machine, you can just link to Outlook ActiveX Object to send the email for you.

In your VB program, goto PROJECT->REFERENCES. Then choose Microsoft Outlook x.x Object Library. Hit OK once done.

Use the code below as a sample:

function SendOutlookMail(szTo as string, szContent as string) as boolean
Dim oOutlook as Outlook.Application ' outlook object
Dim oMail as Outlook.MailItem ' mail item object

' trap err
on error GoTo trap_err

set oOutlook = new Outlook.Application ' create outlook
set oMail = oOutlook.CreateItem(olMailItem) ' create mail item

' prepare to send email
oMail.to = szTo
oMail.Subject = "Auto-generated Email"
oMail.Body = szContent
oMail.Send

' close objects
Call oMail.Close(olDiscard)
oOutlook.Quit
SendOutlookEmail = true
Exit Function

trap_err:
' process error
SendOutlookEmail = false
end function




-Cool Bizs

cksiow
March 18th, 2001, 11:09 PM
if you want to use winsock, can try
http://vblib.virtualave.net

wbeetge
March 22nd, 2001, 03:54 AM
If you still need help on this, you can download the jmail.dll from internet. It is a free app and allows you to send mail without starting or using a mail session (You dont need mail istalled on that PC)