+ Reply to Thread
Results 1 to 10 of 10

sending email from outlook using vba excel

  1. #1
    Registered User
    Join Date
    07-28-2012
    Location
    dubai
    MS-Off Ver
    excel 2010
    Posts
    7

    sending email from outlook using vba excel

    Dear All,

    I am new to the forum. kindly help me in getting VBA codes for sending emails by collecting information from excel (Column A- date, B - recipient id,C subject, D - cc, E - message body) as and when current date is equals to the Date in Column A


    E.G -

    A-------------------------- B---- C------------- D------------------- E
    Date Recipient id Subject cc Message Body
    28/07/2012 [email protected] report [email protected] report for the month..
    28/07/2012 [email protected] report [email protected] report for the month..
    30/07/2012 [email protected] report [email protected] report for the month..
    31/07/2012 [email protected] report [email protected] report for the month..
    01/08/2012 [email protected] report [email protected] report for the month..
    02/08/2012 [email protected] report [email protected] report for the month..
    03/08/2012 [email protected] report [email protected] report for the month..
    04/08/2012 [email protected] report [email protected] report for the month..


    Thanks in advance
    Josh
    Last edited by joshshaji; 07-28-2012 at 05:18 AM.

  2. #2
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: sending email from outlook using vba excel

    Hi Josh
    Welcome to Excel Forum. Please when asking a question such as yours supply a sample workbook rather than placing the data into the thread as it make supplying an answer easier otherwise the person offering the solution may need to recreate a workbook to reflect your data. To add a sample workbook select "Go Advanced", "Manage Attachments" and upload a sample workbook. Make sure the sample workbook contains no sensitive or private data.
    Based on your explanation the following should send an email if the current date matches the date in Column A. If it does not help you then please supply a sample workbook. In this case I assume the data starts in Row 2. I have placed some comments into the code to help you where changes may need to be made depending on your workbook layout. This code will display the email - change Display to Send where indicated to just send the email.
    Please Login or Register  to view this content.
    If you have any questions please ask.
    Hope this helps.
    Anthony
    Pack my box with five dozen liquor jugs
    PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated?

  3. #3
    Registered User
    Join Date
    07-28-2012
    Location
    dubai
    MS-Off Ver
    excel 2010
    Posts
    7

    Re: sending email from outlook using vba excel

    Thank you for your help, and i tried uploading the file when i made this post but i had issues uploading..

    But i have one more question to ask

    how to send the email if there are 2 recipients on the same date, with diff subj and body..

    Thanks in advance

    attachment : example.xlsm
    Last edited by joshshaji; 07-29-2012 at 07:05 AM.

  4. #4
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: sending email from outlook using vba excel

    The code I wrote above will iterate through all the dates and if there are multiple emails to send with the same date does the code not do what you require? What happens with the code when there are multiple emails for the same date - does the code not work in that situation?

  5. #5
    Registered User
    Join Date
    07-28-2012
    Location
    dubai
    MS-Off Ver
    excel 2010
    Posts
    7

    Re: sending email from outlook using vba excel

    Hi Anthony, thank you so much for the valuable input, however the code when tried is sending only one email ( the first one in the list, which is current date ) while the other current dated ones are ignored. request your help.

    Thanks

    Josh
    Last edited by joshshaji; 07-29-2012 at 01:26 PM.

  6. #6
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: sending email from outlook using vba excel

    The code needs to be changed a little - try the following
    Please Login or Register  to view this content.
    This will SEND every email that matches today's date

  7. #7
    Registered User
    Join Date
    07-28-2012
    Location
    dubai
    MS-Off Ver
    excel 2010
    Posts
    7

    Re: sending email from outlook using vba excel

    Hi Anthony,

    It works perfectly, and thank you for the quick and prompt help

    Josh

  8. #8
    Registered User
    Join Date
    07-31-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel Mac 2011
    Posts
    4

    Re: sending email from outlook using vba excel

    Thanks for the great posts guys, trying to do something similar using RDB's coding but it keeps coming up with compile errors.

    Is it possible to tweak the basic code to compile a pdf of cells B1:I56 and send to recipient in L4 on button activation using default email program?

    Having a lot of trouble combining the VBA sections and every time I get compile errors.

    My main goal is to have the participant value as a listbox with all sections filled out in vlookup with a simple macro button to compile and send through the default mail with a standardised subject and filename.

    I should also note, I'm editing this in Excel for Mac 2011 and want it to be compatible with older versions of excel on PC's
    Attached Files Attached Files
    Last edited by dcsuperman; 07-31-2012 at 07:44 AM.

  9. #9
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: sending email from outlook using vba excel

    Hi and welcome to Excel Forum - I would ask that you read our forum rules at http://www.excelforum.com/forum-rule...rum-rules.html
    Please don't post a question in the thread of another member -- start your own. If you feel this thread is particularly relevant to your problem then provide a link to the this thread. If you repost your question in a new thread I am sure you will receive the help that you require.

  10. #10
    Registered User
    Join Date
    07-31-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel Mac 2011
    Posts
    4

    Re: sending email from outlook using vba excel

    Quote Originally Posted by smuzoen View Post
    Hi and welcome to Excel Forum - I would ask that you read our forum rules at http://www.excelforum.com/forum-rule...rum-rules.html
    Please don't post a question in the thread of another member -- start your own. If you feel this thread is particularly relevant to your problem then provide a link to the this thread. If you repost your question in a new thread I am sure you will receive the help that you require.
    Awesome thanks for the heads up

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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