Hi,
I have used CDO object in my vb.net code to send a mail. When i Send a mail, it sends the mail only after closing the application. Can any one help me please ?.
my code is below.
objmessage = CreateObject("CDO.Message")
objmessage.Subject = oUDS26.Value
objmessage.From = strUserEmail
objmessage.To = oUDS27.Value
objmessage.TextBody = "Please find the attachment."
objmessage.addattachment(strAttachment)
With objmessage.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPServer
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = strSMTPUser
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = strSMTPPassWord
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = CType(strSendUsing, Integer)
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = CType(strSmtpAuthentication, Integer)
.item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = CType(strSmtpPort, Integer)
.Update()
end with
objmessage.Send()
Thanks in advance.
Kandan Mani.