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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending E-mail with Attachment

Status
Not open for further replies.

sms28

IS-IT--Management
Dec 10, 2002
19
US
I'm completing a theatre attendance tracking database. The user has a requirement to send via e-mail the flyers advertising each performance. The database contains e-mail addresses. What is the best way to accomplish?

Thanks in advance.
 
here is some psuedo code...
...
lcSubject = "WebSeries Daily Alert: " & rsReports("REPORT_Name") & " Value Date " & ldTemp
lcObjectName = lcQueryName
'E-Mail Report
llCheck = SendEMailOut(lcEMailAddress, lcSubject, lcMessage, lcObjectType, lcObjectName, lcFormatType)
If llCheck = False Then
MsgBox ("Error Sending Emails")
Else
lcComment = "Prior Day Payments Summary EMail Sent to " & lcEMailAddress
lcSQLLog = "INSERT INTO tbl_Log (REPORT_TIME,QUERY_NAME,RECORD_COUNT,COMMENTS) "
lcSQLLog = lcSQLLog & "VALUES ('" & lcTime & "','" & lcObjectName & "'," & rs.RecordCount & ",'" & lcComment & "')"
ThisDB.Execute lcSQLLog, dbFailOnError
End If

...

lcMessageText2 = lcMessageText2 & "Note: Failure to Contact IT Help Desk Within a Reasonable Time May Result in WebSeries Account Suspension." & vbCr
llTestCall = SendEMailOut2(rs("EMAILAddress"), lcSubject2, lcMessageText2)
If llTestCall = True Then
'write to log
Else
'msgbox?
End if
...
Public Function SendEMailOut2(lcEM, lcSUBJ, lcMess)
On Error GoTo Err_SendEMailOut2
DoCmd.SendObject acSendNoObject, "", acFormatTXT, lcEM, , , lcSUBJ, lcMess, False
SendEMailOut2 = True

Exit_SendEMailOut2:
Exit Function

Err_SendEMailOut2:
SendEMailOut2 = False
MsgBox Err.DESCRIPTION
Resume Exit_SendEMailOut2
End Function
...
Public Function SendEMailOut(lcEM, lcSUBJ, lcMess, lcObjType, lcObjName, lcFormat) As Boolean
On Error GoTo Err_SendEMailOut
DoCmd.SendObject acSendQuery, lcObjName, acFormatXLS, lcEM, , , lcSUBJ, lcMess, False
SendEMailOut = True

Exit_SendEMailOut:
Exit Function

Err_SendEMailOut:
SendEMailOut = False
MsgBox Err.DESCRIPTION
Resume Exit_SendEMailOut
End Function

Steve Medvid
"IT Consultant & Web Master"
e-Mail: Stephen_Medvid@GMACM.com

Chester County, PA Residents
Please Show Your Support...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top