Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   .NET Communications (http://www.xtremevbtalk.com/-net-communications/)
-   -   Sending emails from VB application like outlook (http://www.xtremevbtalk.com/-net-communications/327259-sending-emails-vb-application-outlook.html)

python01 09-11-2014 09:38 PM

Sending emails from VB application like outlook
 
I have written an application in VB.NET which reads excel file and then sends some emails out based on the content of the file.
Although everything works fine on my home workstation with my internet provider SMTP server, at the office it is not sending any emails. When I contacted IT I received the following reply:
"In order for this to work on base workstations you would need to make sure the application can send an email much like Outlook would send SMTP emails…"
Could anyone let me know how to write code to emulate outlook? Or what steps to take to make sure my application behaves in same fashion as outlook would?
Below is my code used to send emails:

'Send email
Dim mailInstance As MailMessage = New MailMessage(fromemail, recipientemail, subject, emailbody)
Dim mailSenderInstance As SmtpClient = New SmtpClient(smtpaddress, portnumber)
mailSenderInstance.UseDefaultCredentials = False
mailSenderInstance.EnableSsl = enablessl
mailSenderInstance.Credentials = New System.Net.NetworkCredential(username, emailpassword)
mailSenderInstance.Send(mailInstance)
mailInstance.Dispose()

Thank you for your help.


All times are GMT -6. The time now is 11:35 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.