EDIT: aMail (as referenced below) comes from the statement "Imports aMail = Aspose.Network.Mail"
Chances are I'm doing something wrong, so I thought you could tell me where. I'm trying to connect to our exchange server and send out an email directly from there. I'm assuming by doing it this way, rather than using a virtual SMTP server to send the email, that the headers will look the same as if I had sent the message using Outlook. Please correct me if I am wrong. My code and the error I am receiving follows.
Dim myExchange As New aMail.MailExchangeConnection
myExchange.Host = "xxx.xxx.xxx.xxx"
myExchange.Username = "username"
myExchange.Password = "password"
Dim mySMTP As New aMail.SmtpClient(myExchange)
Dim myEmail As New aMail.MailMessage
myEmail.From = New aMail.MailAddress("firstname.lastname@example.org")
myEmail.Subject = "Test email"
myEmail.Body = New aMail.TextPlainBody("this is a test")
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.