A1VBCode Forums

Cant send email in another computer using system.net.mail


http://www.a1vbcode.com/vbforums/Topic32242.aspx

By teszero - 11/30/2014

Hello. I am developing a very simple smtp email sender.

I made it, i tested it, and it works fine but... only in my developer computer.



In all other computers that i install my application, it gives me "Failure sending email"

I am developing in the same network than the other machines, all computer under windows xp.



I found a difference, some of the computer uses netframework 3.5 and i was developing this application in netframework 4.0.

I tryed to change it to 3.0 and 3.5 but... with the same result...



Can it be because the class import?

in two days... i cant find the solution Sad



do i need to install something in the other machines? or add a reference file?



my code is this:



_______________________________________________



Imports System.Net.Mail



Public Class Form1



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

On Error GoTo 11

Dim msg As New MailMessage()

msg.From = New MailAddress("test@gmail.com", "Email Test")

msg.To.Add("myemail@yahoo.com")

msg.Subject = "Hey, this is a test"

msg.Body = "smtp email sending test"

Dim client As New SmtpClient()

client.Host = "mysmtp"

client.Port = 25

client.Send(msg)

MsgBox("OK")

GoTo 10



11:

MsgBox(Err.Description)

10:

End Sub





End Class



_____________________________________________________





Thank you in advance for your help.



Regards

Pedro Silva

Portugal
By Destroyer - 12/1/2014

Check the antivirus settings on the client. They may be interfering with sending of the mail.