Results 1 to 3 of 3
  1. #1
    Asma is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    11

    Unhappy How can I send an email from access???

    Hi

    I want to send an email from access to a specified group and I don't know how and where to do that???

    Would it be a part of a Form or Report or where shall I have the emailing part in my database??

    Another question is Can I change the sender everytime I send an email or i should have one email address fixes as Sender??

    Please provide me with any references you think it will be helpful .

    Thank you in advance

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Start by looking in VBA help at SendObject or FollowHyperlink (used with MailTo. You could have it pretty much anywhere you needed it. It will use the email address of the PC the code is running on by default, but you can use SendOnBehalfOf to change the sender if you use automation (double check that, as I may have misspelled it). Lots of info here:

    http://granite.ab.ca/access/email.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    aelissaw is offline Novice
    Windows Vista Access 2003
    Join Date
    Dec 2011
    Posts
    2
    I have had this problem for long time, till i found that code in one of the forums, use the instruction in the comment section. hopefully this will help.




    Sub SendMail()
    Dim loRef As Access.Reference
    Dim intCount As Integer
    Dim intX As Integer
    Dim blnBroke As Boolean
    Dim strPath As String

    ' add code to send mail ------

    '"writing SMTP control" - sample project, based on OstroSoft SMTP component
    'written by Igor Ostrovsky (OstroSoft)
    '
    'OstroSoft SMTP component is available for download at
    'http://www.ostrosoft.com/download/smtp_component.zip
    'email questions, suggestions, comments to info@ostrosoft.com
    '
    'reregister DAO - regsvr32 "C:\Program Files\Common Files\Microsoft Shared\DAO\DAO350.dll"
    'register OSSMTP.dll than add as a reference

    'THIS IS WAHT KARL DID TO GET THIS TO WORK
    'IT HAS TO BE DONE ON THE COMPUTER THAT THIS RUNS ON
    'download this zip file
    'http://www.ostrosoft.com/download/smtp_component.zip
    'extract OSSMTP.dll from zip into C:\WINDOWS
    'go to start run and enter 'cmd'. then key in 'regsvr32 OSSMTP.dll'
    'open this 'Public Sub SendMail()' module and navigate to Tools\References and check the box next to 'OstroSoft SMTP component'

    Dim oSMTP As New OSSMTP.SMTPSession
    oSMTP.MailFrom = senderemail@add.com
    oSMTP.Server = "Server.com"
    oSMTP.Port = 25
    'this one is for testing oSMTP.SendTo = "email00@add.com"
    ' seperate multiple names by a ,
    oSMTP.SendTo = "email@add.com1, email2@add.com, email3@add.com"

    'oSMTP.SendTo = "email@add.com1, email2@add.com, email3@add.com"


    ' seperate multiple names by a ,
    'oSMTP.SendTo = "Your Email address"
    ' seperate multiple names by a ,
    oSMTP.MessageSubject = "Daily Chrysler Invoices"
    oSMTP.MessageText = "Please see attachment."
    oSMTP.Attachments.Add ("S:\PURCHASE\USERS\AEl-lissawi\Auto_Email\OE_Reports\ChryslerInvoices.xls ")
    oSMTP.SendEmail



    'MsgBox "Email has been sent ..."


    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 10-09-2009, 08:15 AM
  2. Send email using SendObject instruction
    By stecco in forum Access
    Replies: 4
    Last Post: 09-09-2009, 01:55 AM
  3. Replies: 1
    Last Post: 05-01-2009, 07:33 AM
  4. Beginner trying to send email with attachment
    By ahm in forum Programming
    Replies: 2
    Last Post: 03-24-2009, 08:51 PM
  5. Net Send from a button on an Access form
    By Deb4995 in forum Forms
    Replies: 0
    Last Post: 10-19-2006, 10:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums