+ Reply to Thread
Results 1 to 4 of 4

Mail sending through macro

  1. #1
    Forum Contributor
    Join Date
    07-17-2012
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    461

    Mail sending through macro

    Hi All,

    I have a VB code to send a mail from excel. And I want few changes has to be done in the macro.
    1. I want to change code to send mails from windows live, as I am not using outlook.
    2. I need the mail to send according to time which I can set.

    Please find the below mentioned code.

    Sub Test1()
    'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
    'Working in Office 2000-2013
    Dim OutApp As Object
    Dim OutMail As Object
    Dim cell As Range

    Application.ScreenUpdating = False
    Set OutApp = CreateObject("Outlook.Application")

    On Error GoTo cleanup
    For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
    If cell.Value Like "?*@?*.?*" And _
    LCase(Cells(cell.Row, "C").Value) = "yes" Then

    Set OutMail = OutApp.CreateItem(0)
    On Error Resume Next
    With OutMail
    .To = cell.Value
    .Subject = "Reminder"
    .Body = "Dear " & Cells(cell.Row, "A").Value _
    & vbNewLine & vbNewLine & _
    "Please contact us to discuss bringing " & _
    "your account up to date"
    'You can add files also like this
    '.Attachments.Add ("C:\test.txt")
    .Send 'Or use Display
    End With
    On Error GoTo 0
    Set OutMail = Nothing
    End If
    Next cell

    cleanup:
    Set OutApp = Nothing
    Application.ScreenUpdating = True
    End Sub

  2. #2
    Forum Contributor
    Join Date
    07-17-2012
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    461

    Re: Mail sending through macro

    Any modifications done?
    Last edited by sathishkm; 08-27-2013 at 04:00 PM.

  3. #3
    Forum Contributor
    Join Date
    07-17-2012
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    461

    Re: Mail sending through macro

    Any idea about it?

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Mail sending through macro

    Hi, sathishkm,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ 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. Mail sending througg macro
    By sathishkm in forum Excel Programming / VBA / Macros
    Replies: 40
    Last Post: 08-28-2013, 01:34 PM
  2. Macro for sending Outlook mail - Need help
    By Raju Radhakrishnan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-10-2013, 06:22 AM
  3. Macro for sending mail with attachment
    By shaifudheen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-06-2013, 04:55 AM
  4. Replies: 1
    Last Post: 12-28-2012, 03:46 AM
  5. Macro For Sending Mail with Attachemnt
    By manian in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2011, 01:10 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