I use the code below for emailing attachments
My trouble is that I need to automate this process and therefore want to remove the EmailSend.Display line of code. However when I do this outlook will not send the e-mail (I get no error messages, but I never receive the mail) but the code works perfectly when I leave this line of code in.
Any Suggestion would be greatly appreciated
Dim EmailApp, NameSpace, EmailSend As Object
Set EmailApp = CreateObject("Outlook.Application")
Set NameSpace = EmailApp.getNameSpace("MAPI")
Set EmailSend = EmailApp.CreateItem(0)
EmailSend.To = "Davies Matthew J (ISeLS NSG)"
EmailSend.Subject = "Here is your attachment"
EmailSend.Attachments.Add "C:\WebServerUG.doc"
EmailSend.Display
Set EmailApp = Nothing
Set NameSpace = Nothing
Set EmailSend = Nothing
Thanks in advance
My trouble is that I need to automate this process and therefore want to remove the EmailSend.Display line of code. However when I do this outlook will not send the e-mail (I get no error messages, but I never receive the mail) but the code works perfectly when I leave this line of code in.
Any Suggestion would be greatly appreciated
Dim EmailApp, NameSpace, EmailSend As Object
Set EmailApp = CreateObject("Outlook.Application")
Set NameSpace = EmailApp.getNameSpace("MAPI")
Set EmailSend = EmailApp.CreateItem(0)
EmailSend.To = "Davies Matthew J (ISeLS NSG)"
EmailSend.Subject = "Here is your attachment"
EmailSend.Attachments.Add "C:\WebServerUG.doc"
EmailSend.Display
Set EmailApp = Nothing
Set NameSpace = Nothing
Set EmailSend = Nothing
Thanks in advance