Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Email Addresses (Excel XP)

    I'm sending a worksheet with the following code inside a macro:

    ActiveWorkbook.SendMail Recipients:=EmailName(a), Subject:="All Calls"

    I'm populating a variant EmailName with the email addresses of the recipients.

    Some of the address are for example msmit@abc.com & another is mvsmit@abc.com. What happens is that the worksheet is addressed as mvsmit@abc.com but it goes to msmit@abc.com. It almost as if it does an auto correction of the name. Any ideas or suggestions would be appreciated.

    Thanks

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Email Addresses (Excel XP)

    How are you populating the array, EmailName?

    Steve

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Email Addresses (Excel XP)

    Multiple recipients must be an array argument, such as:

    ActiveWorkbook.SendMail Recipients:=Array("msmit@abc.com", "mvsmit@abc.com"), Subject:="All Calls"

    you'll need to structure your code to fit.
    -John ... I float in liquid gardens
    UTC -7ąDS

  4. #4
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Email Addresses (Excel XP)

    Sorry to confuse you all.

    I have a sheet in Excel with the the following:

    Dept Email
    a mvsmit@abc.com
    b dadavids@abc.com

    I use the following code to open & populate the array:

    For a = 1 To 19

    emailDivision(a) = Cells(a, 1)
    EmailName(a) = Cells(a, 2)

    Next a

    Now when I email the attachment for some strange reason the email goes to msmit@abc.com & ddavids@abc.com. It must be something on the send that autocorrects the email address. If I take the attachment and manually put in the email address it doesn't change it.

    Please assist

  5. #5
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Email Addresses (Excel XP)

    If/When you setp thru the code, when you get to the line to "read" the array, what is the value being fed to the program. Are you sure the array is correct at that point?

    Steve

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Email Addresses (Excel XP)

    I'm still not clear; emaildivision and emailname are not Excel VBA Properties that I know of, so I don't understand what data types they are nor how you are building the array. See Steve's advice <!post=here,286687>here<!/post> for a better way to build a Recipients array from a range in a spreadsheet. Also, your email client may be automatically resolving the addresses; make sure the exact addresses that you are sending to are in your active address books.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •