+ Reply to Thread
Results 1 to 6 of 6

Send Email from a specific Email Address

  1. #1
    Forum Contributor
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    120

    Send Email from a specific Email Address

    Good evening everyone,

    during a private small "invoicing" project, I was forced to use VBA, which is a complete new territory for me and I started to watched the videos from Chester Tugwell,
    who did a great job (at least, I think so), showing some VBA code, how to setup a simple automated invoicing tool.

    https://www.youtube.com/watch?v=lEgg...nnaD57&index=6

    In the last series (see link above) he shows, how to prepare an invoice in Excel, to be attached as an pdf to Email and to send it by Outlook.

    The code for this part looks like as seen below:

    I wonder, how to extend the code on such way, so it is always sending the mail from a specific email address?

    I will add the Excel that contains the full macro.

    Thank you very much for your help and support,

    Mike



    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    907

    Re: Send Email from a specific Email Address

    Just add before your code .To = Range("B16") this line:
    Please Login or Register  to view this content.
    Should do.

  3. #3
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    Re: Send Email from a specific Email Address

    I don't think .SentOnBehalfOfName works. It is a security issue. In Outlook you can add an account then send email from that account.

  4. #4
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    907

    Re: Send Email from a specific Email Address

    @mogul, on my old O2K16 it still works but since OP has O365 I can only cross my fingers .

  5. #5
    Forum Contributor
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    120

    Re: Send Email from a specific Email Address

    Hello Rollis13,

    That is interesting, I saw that while searching for a solution but I had the impression, that command is used, when you want to send a mail On behalf of someone else as it says.

    The funny thing is, it works , as long as I have the permission to do so.

    For me, it works and if there is another solution, please let me know,

    Thank you very much to all of you,

    Mike

  6. #6
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    907

    Re: Send Email from a specific Email Address

    If you have more than one account (email addresses) in your Outlook then, if it isn't the default account, this is "send a mail On behalf of someone else" .
    Thanks for the feedback, glad having been of some help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Send email from Excel_'To address' not in excel_Copy & Open email template
    By NametobeRenamed in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-11-2022, 08:59 AM
  2. Send email from a specific email address
    By Bobbbo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2021, 01:20 PM
  3. [SOLVED] Email Send Macro - 0 pulling into CC field when no email address present
    By toriwoo86 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-26-2021, 02:18 PM
  4. [SOLVED] vba email send from excel - ignore second email address if "ENTER EMAIL ADDRESS"
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2016, 07:22 AM
  5. VBA code to send email to the people whose email address is in the Access table
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2014, 05:11 AM
  6. Send workbook to specific email address
    By tulliofn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2013, 09:29 AM
  7. Replies: 6
    Last Post: 12-02-2011, 02:14 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1