I'm trying to use an Exchange Server to send emails from asp.net web application and atm the mail is getting stuck in the drafts folder and not being sent.
Emails are being sent fine if i send them using browser or outlook directly. Also if i go to the drafts folder and manually send the vb.net created emails they re being sent and received fine aswell, but that isn't a long term option. If anyone has any idea what is the problem i'ld appreciate the input.
Here is the relevant part of the code i m using.
Try
Dim service As ExchangeService
Dim service As New ExchangeService(ExchangeVersion.Exchange2007_SP1)
service.Credentials = New WebCredentials(System.Configuration.ConfigurationManager.AppSettings("Username"), _
System.Configuration.ConfigurationManager.AppSettings("Password"))
service.Url = New Uri(System.Configuration.ConfigurationManager.AppSettings("ExchangeServer"))
Dim message As New EmailMessage(service)
message.Subject = New String("Test")
message.Body = New String("Just testing")
message.ToRecipients.Add(name, email)
message.SendAndSaveCopy()
Catch ex As Exception
Return False
End Try
Return True


LinkBack URL
About LinkBacks




Reply With Quote

Bookmarks