+ Reply to Thread
Results 1 to 2 of 2

Macro - automatic email sending

  1. #1
    Registered User
    Join Date
    01-22-2022
    Location
    Rzeszów,Poland
    MS-Off Ver
    365
    Posts
    38

    Macro - automatic email sending

    Hi

    Could you please help me with following problem.

    I need to have mechanism to quick send a lot of emails automatically.

    Please find attached example.

    Automat should to send the email via outlook(from my email) to recipient with information about relationship and short text.

    Is it possibly?

    Some recipients will have several people to send to each other and vice versa.

    Thanks in advanced
    BR
    Andrzej
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Macro - automatic email sending

    Attached is my response.

    I have a "standard" mailer program in VBA that sends mail. All you have to do is pass arguments to it. It takes the following arguments.
    ' ToString = List of addressees in To field, semicolon delimited
    ' SubjectString = Subject of the mail Message
    ' BodyString = Body of the mail message
    ' ReplyTo = (Optional) Reply to email address
    ' OnBehalfOf = (Optional) Mail on behalf of (must have permissions)
    ' CCString = (Optional) List of addressees in CC field, semicolon delimeted
    ' BCCString = (Optional) List of addresses in BCC filed, semicolon delimited
    ' AttachmentName = (Optional) List of full-path name attachments, semicolon delimited
    ' HTMLRange = (Optional) Range to include as HTML
    ' SendDisplay = (Optional) True = Send mail automatically, False = display only as draft - the default is FALSE

    Just a word about how this works. With the arguments I supplied, the mail is sent out on behalf of the sender and the replies should go to the sender. However, the outgoing mail will wind up in the Outlook sent mail folder for the mail account actually sending the mail. Please note that in order to send the mail out on behalf of a person, that you must have permission to the mailbox. If you get an error then remove the argument in the OnBehaldOf, simply leave it blank between the commas.

    Please Login or Register  to view this content.
    An explanation on the mail flag: if it is set to false, the mailer displays the mail to be sent but does not send it. This will stack the mail up on the desktop. The display will give you a last chance to cancel the mail or to edit it before sending it. If the flag is set to true, the mail will go out automatically.

    The program goes through the table on the Mail Table sheet and sets up the information on the Mail Information sheet. I try to get basic Excel to do as much of the work as possible, so I don't have to do it in code. It also makes things more flexible.

    You do have the ability to send an attachment. Cell B8 on the Mail Information sheet is where to enter this information. Use a complete pathname to where the attachment exists. Leave this cell blank if there is no attachment.

    The cells on the Mail Information sheet are either read from the Mail Table or are calculated.
    - Today is simply the current date - do not modify this cell
    - Due date is calculated. I set it for 15 days, you can set it to whatever you want.
    - Recipient is read from the table - this information will be overwritten with the appropriated information as the program goes through the Mail Table.
    - Recipient Email is read from the table - this information will be overwritten with the appropriated information as the program goes through the Mail Table.
    - Sender Email is read from the table - this information will be overwritten with the appropriated information as the program goes through the Mail Table.
    - Subject - fill this in with whatever information you want, even a formula
    - Attachment - discussed above
    - Mail Flag - discussed above
    - Survey Type is read from the table - this information will be overwritten with the appropriated information as the program goes through the Mail Table.
    - Body - I provided a formula to compute the body based on my understanding of what you need the program to do. You can replace this with whatever you want

    As you can see, this program has the capability to be used for different kinds of mailings. Change the information in the Mail Table and play with the formulas on the Mail Information Sheet.
    Attached Files Attached Files
    Last edited by dflak; 04-01-2023 at 11:50 AM.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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] Automatic Email Sending from excel
    By elyas91 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2021, 09:34 AM
  2. Optimize Macro for Sending Automatic Email via Lotus Notes
    By Kaustubh1040 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2020, 11:07 AM
  3. Sending automatic email with Excel Macro
    By sudeep19 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-07-2019, 02:42 AM
  4. Need Macro for sending an automatic email based on expiry dates
    By abeharrell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-11-2017, 12:12 PM
  5. [SOLVED] Excel Automatic Email Sending
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2013, 02:30 AM
  6. Automatic sending email
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-19-2011, 03:37 AM
  7. Sending automatic email + Bloomberg
    By freddie mac in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-12-2006, 08:00 AM

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