hello!
i create a programme that's used my hotmail account so i send e-mail to another account so it's worked but on another computers it's doesn't work and i don't know why in my laptop the programme work and in another laptops or desktops the programme don't do anything.
so i need your help!!!
thank you :)

Dani AI

Generated

Symptoms reported by (works on one laptop, silent on other machines) usually point to environment or connectivity differences rather than a logic bug. asked for the code and suggested framework mismatches; with the posted handler there are three high‑probability areas to check first: SMTP authentication settings, network/port blocking, and how asynchronous sends report errors.

Common, practical checks (in order):

  • Confirm the required .NET runtime is installed on each target machine and that the app is built for that runtime. Differences between 2.0/3.5 vs the installed runtime can cause behavior differences.
  • Verify SMTP authentication is applied correctly. When explicit credentials are supplied, default Windows credentials must not be left enabled; otherwise the explicit credentials are ignored and authentication fails.
  • Try a synchronous send or wire up the SendCompleted handler so any asynchronous error surfaces (errors from async operations are reported via the completion event, not the original try/catch).
  • Test network reachability to the mail server from the problem machines (telnet or equivalent to the server:port). Many networks block port 25; modern SMTP submission typically uses port 587 with TLS. Also check local firewall/AV and corporate router rules.
  • Temporarily test the same account from a problem machine while on the laptop’s network (tethering or same Wi‑Fi). If it then works, the issue is at network/ISP/router level.
  • Log the full exception text from the async completion (Error and InnerException) or from a synchronous Send to get the real cause; that text is key for the next step.

Note: silent failures are often caused by using SendAsync without handling SendCompleted or by leaving UseDefaultCredentials true when supplying NetworkCredential. Collect the async completion error or synchronous exception and the network test results to identify whether the failure is authentication, port/SSL, or a blocked connection.

Recommended Answers

All 6 Replies

What exactly does not work? its just the program wont start at all, or it crash at certain point?

no the program open normaly and in the send button nothing happened.

Can i see that piece of code? and what namespace are you using? System.Net.Mail?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim SendMail As System.Net.Mail.MailMessage
Dim ServerSMTP As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient("smtp.live.com", 25)
ServerSMTP.UseDefaultCredentials = True
ServerSMTP.Credentials = New System.Net.NetworkCredential("", "password")
ServerSMTP.EnableSsl = True

SendMail = New System.Net.Mail.MailMessage("", "")
SendMail.Subject = "test"
SendMail.Body = TextBox1.Text

ServerSMTP.SendAsync(SendMail, Me)
Catch ex As Exception
Dim msg As String = ex.Message

If ex.InnerException IsNot Nothing Then
msg &= ". " & ex.InnerException.Message
End If

MessageBox.Show("An exception occurred with the message:" & Environment.NewLine & msg)
End Try
End Sub

Do the other machines have .net framework installed or updated?
Your developing machine is working fine because you have all the .net requisites.

Do you use a Reference in you program that is linked with a software that is installed in your machine i.e. "MSN messenger version XX"

no i don't use any reference just this code.
and i try it in pc that VS 2010 2008 and 2005 was installed (separately) i use VS 2005 but .net framework updated to 3.5 or i have 1.0 2.0 (VS 2005) and 3.0 3.5 (so here i have a question ,VS 2005 use .net framework 2.0 so if i have 3.5 it's automatically updated to 3.5 ? )and i try this in XP windows 7 and vista.
and i have asp.net send e-mail and it doesn't work either only in my laptop work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.