Results 1 to 3 of 3
  1. #1
    SMcGrath is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    4

    E-Mail code adding #mailto:

    I recently updated to Office 2010 and did not have any problem with this e-mail code in 2003. Now my addresses are not looking correct:



    jgross978@gmail.com#mailto:jgross978@gmail.com#; dmillett@masiello.com#mailto:dmillett@masiello.com#;

    What is causing this?

    Dim rs As DAO.Recordset
    Set rs = Me.FrmSubRealtors1.Form.RecordsetClone
    Dim tostr As String
    Dim mess_body As String
    Dim appOutlook As Outlook.Application
    Dim MailOutlook As Outlook.MailItem
    Set appOutlook = CreateObject("Outlook.Application")
    Set MailOutlook = appOutlook.CreateItem(olMailItem)
    If rs.EOF = False Then
    rs.MoveFirst
    Do Until rs.EOF
    If rs.Fields!Email <> "" Then
    tostr = tostr & rs.Fields!Email & ";"

    End If
    rs.MoveNext
    Loop
    tostr = Left(tostr, Len(tostr) - 1)
    rs.Close
    Set rs = Nothing
    mess_body = "PeoplesBank Mortgage Consultant"

    Set appOutlook = CreateObject("Outlook.Application")
    Set MailOutlook = appOutlook.CreateItem(olMailItem)
    With MailOutlook
    .To = smcgrath@bankatpeoples.com
    .BCC = tostr
    .Subject = mess_body
    .Display
    End With
    End If

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You should have quotes around the email address in your .To

    .To = "smcgrath@bankatpeoples.com"

    What text is in your table with the addresses for your Bcc?

    Perhaps initializing tostr right after the declaration
    tostr = ""

    and then

    If rs.Fields!Email <> "" Then
    tostr = tostr & rs![Email] & "; " 'if I recall I place a space after the semicolon

    End If


    edit
    and then you need to parse two spaces in your left function Left(tostr, Len(tostr) - 2)

  3. #3
    SMcGrath is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    4
    Thank you. I noticed that when I updated the field from hyperlink to text that it added in the #Mailto: so I stripped that from the field and it is working.

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

Similar Threads

  1. mailto with Subject
    By umarus in forum Programming
    Replies: 4
    Last Post: 12-20-2012, 12:58 PM
  2. Trying to get mail merge code to work
    By itm in forum Programming
    Replies: 0
    Last Post: 09-13-2012, 01:01 PM
  3. VBA Code for Mail Merge via Dynamic Data Exchange
    By Ganymede in forum Programming
    Replies: 2
    Last Post: 12-28-2011, 05:20 PM
  4. Quick help w/ Mailto??
    By Visfire in forum Programming
    Replies: 3
    Last Post: 09-17-2010, 08:36 AM
  5. Formatting E-mail Using Code
    By graviz in forum Programming
    Replies: 10
    Last Post: 12-10-2009, 10:10 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