+ Reply to Thread
Results 1 to 3 of 3

vba to fetch email id and send emails automatically

  1. #1
    Registered User
    Join Date
    10-09-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    2

    vba to fetch email id and send emails automatically

    Hi
    I have a raw data which has to be sorted and for which i have given codes. Once the data is sorted I have given a code to separate sheets based on column (Col I) filter. Below is the same code i have used,

    Please Login or Register  to view this content.
    Details entered in the Masterdata sheet:

    Account Send Code Email ID
    80000 PTN [email protected]
    80004 RB [email protected]
    80064 PTN [email protected]
    80068 RS [email protected]
    80069 RB-AR [email protected]


    Till this point i was able to create. I need your help in sending automatic email via outlook as below,


    > Once the sheets are separated with the sheet name (Send code in the masterdata sheet), I want to send email automatically to the corresponding email id. For example,

    Sheet- PTN have the details need to be sent to [email protected] automatically with the sheet PTN as attachment,


    I also want to input the body of the email every time. I have multiple send code and their corresponding email id in the masterdata sheet.
    Please help me with the code.


    Many Thanks
    Last edited by abi123; 10-09-2017 at 05:42 AM. Reason: Code not updated correctly

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: vba to fetch email id and send emails automatically

    Hi abi123

    Welcome to the Forum.
    In future please view the forum rules before posting. Your post does not comply with rule #3.
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the [#] button at the top of the post window.
    Unfortunately we are not able to assist until you have corrected this...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    10-09-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    2

    Re: vba to fetch email id and send emails automatically

    Hi*
    I am trying to create a macro to send emails automatically via outlook. Currently i have the raw data which i have sorted according to the Send code mentioned below ,separated the sheets based on the account field. Now i need a code to send email to specific email id based on the send code along with their attachments created(Separated in the same workbook with name of the send code). I want the subject to be the same as send code & allow me to enter the body of the email. Kindly help me.


    Sample of send code and their corresponding email id,
    Account Send Code Email ID
    80000 PTN*[email protected]
    80004 RB*[email protected]
    80064 PTN*[email protected]
    80068 RS*[email protected]
    80069 RB-AR*[email protected]


    Code i have used for separating sheets :


    Please Login or Register  to view this content.
    Column A has the Account field and Column I has the Send code in the prepared sheets for attachment.*
    I am using the below code to send emails. It is sending the entire workbook as attachment to all the specified email id.

    I want to alter the code to send the email to the specific email id based on the sheet name as prepared, for example

    Sheet name/Send code- PTN
    Account - 80000
    Send email to*[email protected]

    Code-

    Please Login or Register  to view this content.
    Please help.

    Sintek,
    Can you check if this is okay?

+ 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. Macro to send emails with different attachments and table in the email.
    By aashish.shetty in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-04-2022, 05:36 AM
  2. [SOLVED] VBA to send emails with different attachments to each seperate email
    By gillyr7 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-14-2014, 02:25 PM
  3. Send email - compile multi lines emails
    By gresham in forum Excel General
    Replies: 1
    Last Post: 04-23-2010, 06:06 AM
  4. Send Email (box that pops up to allow emails to be sent)
    By Slomaro2000 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-19-2009, 06:09 PM
  5. Use excel to automatically send emails
    By cannon_lab in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-18-2007, 06:42 AM
  6. Send an email to a list of emails in a worksheet
    By cexarsiado in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 08-25-2006, 03:30 AM
  7. How to send emails to email-adresses in EXCELL?
    By Alex in forum Excel General
    Replies: 0
    Last Post: 05-25-2006, 09:25 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