Exchange Server email gets stuck in drafts folder not being sent

Daru

New member
Joined
May 10, 2012
Messages
2
Programming Experience
1-3
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
 
Last edited by a moderator:
Back
Top