T
Tran Hong Quang
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
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