Hello, i am making a simple smtp email sender.
i made it, i tested it, it works fine but... only in my developer machine.
in all others machines that i install my application it gives me "Failure to send email"
I am developing in the same network than the other machines.
do i need to install something in the other machines? or add a refference file?
my code is this:
Imports System.Net.Mail
Public Class Form1
Dim mandarmail
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
mandarmail = ("Nota de Encomenda procedente.")
Try
Dim mail As New MailMessage()
mail.From = New MailAddress("my email")
mail.[To].Add("email to send")
mail.Subject = "Nota de Encomenda - " & nr_mec
mail.Body = mandarmail
Dim smtp As New SmtpClient("smtp server")
smtp.Port = 25
smtp.Send(mail)
MsgBox("ok.")
End
Catch ex As Exception
MsgBox(ex.Message)
End Try
'MsgBox err.description
End Sub
End Class
Thank you in advance for your help.
Regards
Pedro Silva
Portugal
i made it, i tested it, it works fine but... only in my developer machine.
in all others machines that i install my application it gives me "Failure to send email"
I am developing in the same network than the other machines.
do i need to install something in the other machines? or add a refference file?
my code is this:
Imports System.Net.Mail
Public Class Form1
Dim mandarmail
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
mandarmail = ("Nota de Encomenda procedente.")
Try
Dim mail As New MailMessage()
mail.From = New MailAddress("my email")
mail.[To].Add("email to send")
mail.Subject = "Nota de Encomenda - " & nr_mec
mail.Body = mandarmail
Dim smtp As New SmtpClient("smtp server")
smtp.Port = 25
smtp.Send(mail)
MsgBox("ok.")
End
Catch ex As Exception
MsgBox(ex.Message)
End Try
'MsgBox err.description
End Sub
End Class
Thank you in advance for your help.
Regards
Pedro Silva
Portugal