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

Email applications

Status
Not open for further replies.

kilt

Technical User
Nov 12, 2002
52
GB
I am using Access 2002 and when i try to use the sendobject function it always loads Outlook, even if i set the default mail to be Outlook Express.

Does anybody know if it is only possible to use Outlook with Access 2002 or if i can somehow change the mail program to Outlook Express.

Thanks.
 
Hi,

I have built something similar to this, but encountered problems when trying to send out 100's of emails. It just stopped sending sometime for no apparent reason.

Also the docm.sendobject tries to open outlook, which can be a pain with outlook security also.

This uses smtp to route the mail out.

Also see another forum called and do a search on cdo email. There's a good thread going on there aboiut it!

Look at the below code.
-------------------------------
Public Function StockEmail_(StockEmail)

Dim mail
Dim strSQL As String
Dim strSubject As String
Dim Attach
Dim strEmail As String

Set mail = Nothing

strEmail = DLookup("LPContactEmail", "setup")


' Send by connecting to port 25 of the SMTP server.
Dim iMsg
Dim iConf
Dim Flds

Const cdoSendUsingPort = 2

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

' Set the CDOSYS configuration fields to use port 25 on the SMTP server.
With Flds
.Item(" = 2 'cdoSendUsingPort
'ToDo: Enter name or IP address of remote SMTP server.
.Item(" = "zebidee"
.Item(" = 10
.Update
End With

' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.To = strEmail 'ToDo: Enter a valid email address.
.from = "emailaddess@email.com" 'ToDo: Enter a valid email address.
.Subject = "Your subject goes here! "
.textbody = "Your Body Goes here!"
Set Attach = iMsg.AddAttachment("you can also add an attachment!")
.Send
End With

' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

End Function

-------------------------------------

hth
brendan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top