CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: send emails

  1. #1
    Join Date
    Feb 2001
    Posts
    9

    send emails

    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


  2. #2
    Join Date
    Feb 2001
    Posts
    54

    Re: send emails

    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


  3. #3
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: send emails

    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

    Good Luck,
    -Cool Bizs

  4. #4
    Join Date
    Apr 2000
    Posts
    737

    Re: send emails

    if you want to use winsock, can try
    http://vblib.virtualave.net


  5. #5
    Join Date
    Oct 2000
    Location
    JHB South Africa
    Posts
    27

    Re: send emails

    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)


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

Featured