Sending mail using CDO via Ms Exchange which forces authentication

G

Guest

Hi,

My function which send mail via CDR is as follows:

Public Function SendEmail(strMailContent As String, strAttachedFilePath As
String, strSentTo As String, strCC As String, strBCC As String, strSubject As
String) As Boolean

Dim iMsg As New CDO.message

With iMsg
.From = "Admin"
.To = strSentTo
.CC = strCC
.BCC = strBCC
.Subject = strSubject
.TextBody = strMailContent
.AddAttachment strAttachedFilePath

.Send

End With

Set iMsg = Nothing

End function

That function is working fine if Ms Exchange is not configured to require
authentication. If Ms Exchange is configured to force sender to authenticate
before sending mail, this function will raise error of "Transport protocol
was failed..." (I don't remember exactly error message).

- How to authenticate with Ms Exchange server using CDO?
- Is there any alternative way to send mail if CDO doesn't support
authenticating? (I don't want to send via Ms Outlook client or using
SendObject because a Security dialog will be appeared to force users to wait
for 5 seconds)

Thanks for any help.

Tran Hong Quang
www.bicsoft.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top