Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto EMail

Status
Not open for further replies.

SymbionA

IS-IT--Management
Apr 16, 2007
45
AU
I want to automatically send an email with an attachment at certain time of the day. I want the app to sit on the server and if I file is dropped in a folder I want that file to be attached to an email and sent.

Currently, the search is down here, has anybody got any similar code available for use?

Many thanks
 
Ok. Search is up. Anyway, I am using this code below, however, I do not receive the email, it just states "Message Sent"

Any ideas why?

Thanks in advance.
-------------------
Private Sub RunEmail_Click()

Dim objOutlook As Object
Dim objEmail As Object

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

strWAEmail = "Name@Company.com"
strWASubject = "Subject of Email"
strWABody = "Body of email goes here"

With objEmail
.To = strWAEmail
.SentOnBehalfOfName = "Name@Company.com"
.Subject = strWASubject
.Body = strWABody
.Importance = olImportanceHigh
.Sent
End With

Set objEmail = Nothing

MsgBox ("message sent")
 
Add

objOutlook.Quit
Set objOutlook = Nothing


----------
Replace olMailItem with 0 and
olImportanceHigh 2

For when a new file is in the folder look here thread222-719707
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top