Email Macro

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Yes. Here's some sample code I used to do it:
Code:
Dim olMailItem As Variant
Set out = CreateObject("Outlook.Application")

    With out.CreateItem(olMailItem)
        'strEmail = "name@domain.com"           'copy and uncomment these two
        '.Recipients.Add strEmail               'lines to add more recipients
        strEmail = "taz@jdomain.net"        'Sets the recipient string
        .Recipients.Add strEmail                'Adds that recipient to the list
        .Subject = "New"
        .Body = "<\\FILEV02\!GENERAL3\!IT\Logs\" & ActiveWorkbook.Name & ">"
'       link to the file; will need to be changed if folder moves or naming scheme changes
'       If the path and or filename has spaces, you must enclose the entire path/filename in angle brackets (<>)
       .Send
    End With

Hope that helps!
 
Upvote 0
At times, a little too much, imho. Don't get me wrong, I think it's great that there's so many ways to do it, depending on what you need, but sometimes it's hard to look at all of that and know right off the bat. Or is it just me? :pray: (Chanting: We're not worthy! We're not worthy!")
 
Upvote 0
No, I don't believe so. Like both solutions provided above, the one I will give is code that uses outlook, but it must be open for the mail to go out. You can make this 'invisible', but I don't think you can use Outlook to send something if it is not open. I could be wrong.

Here is a link to Daniel Klann's website (the greatest code for emailing in Outlook, imho): http://www.danielklann.com/excel/excelvba.htm . There is also a Knowledge Base entry here: http://www.vbaexpress.com/kb/getarticle.php?kb_id=97 written by DRJ that works pretty well. It's about the same concept as DK's.

His Favourites add-in is a must have! I don't know how I got along without it. :)

(Heya Smitty/TG!!)


one_more_cave_dweller said:
Is there a way to have a macro send an email without having to open Outlook?

Thanks :pray:
 
Upvote 0
Btw, if using Outlook and this will be used by multiple users and/or multiple versions, I suggest using Late Binding. Do some reading on it, a board search will wield decent results. DK talks about it a lot.

Good luck! Post back if more help is needed.
 
Upvote 0
can this be adapted to work with Lotus Notes (Smitty's pet hate email prog) ?
if it could it would save me a lot of work at the end of the month. :confused:
 
Upvote 0
HA!

Actually, I can send you some code that I adapted from NateO's original masterpiece, but Nate's is still the best.

Smitty

(Heya fellas!)
 
Upvote 0
pennysaver said:
HA!

Actually, I can send you some code that I adapted from NateO's original masterpiece, but Nate's is still the best.

Smitty

(Heya fellas!)
thanks Smitt, I would appreciate that
 
Upvote 0

Forum statistics

Threads
1,203,069
Messages
6,053,347
Members
444,654
Latest member
Rich Cohen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top