?
Solved

sending an email through my application

Posted on 2010-08-19
4
Medium Priority
?
286 Views
Last Modified: 2013-11-30
I am new to this topic

I have the code below and i want to my application to send emails.

I get the exception "the remote name "ubos.org" could not be resolved"

ubos.org is our active domain name. Also how do i know the name of the local smtp server

Thanks you and regards

Anthony Matovu




 Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        Try
            Dim mm As MailMessage = New MailMessage
            mm.From = New MailAddress("anthonymatovu@yahoo.co.uk", "Anthony Matovu")
            mm.To.Add(New MailAddress("matovu.anthony@gmail.com", "Anthony Matovu"))

            mm.Subject = "Testingf"
            mm.Body = "this is my body"
            mm.IsBodyHtml = False
            Dim client As SmtpClient = New SmtpClient("smtp.ubos.org")
            client.Credentials = Net.CredentialCache.DefaultNetworkCredentials
            client.Send(mm)
        Catch ex As Exception
            MessageBox.Show("error " & ex.ToString)
        End Try

    End Sub
0
Comment
Question by:Anthony Matovu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
robbe earned 2000 total points
ID: 33472905
This depends on which mail server you have. Are you using Exchange ? If so you can use the server name of the exchange server (you can see this in outlook). If your application has to be used outside the organisation i'd suggest you look for an alternative to send mails. The problem is port 25 is most of the time blocked by ISP's. You could ask setup SMTP on an alternative port and make forwarders from an @ ubos.org address to the yahoo and gmail addresses. This way you can connect to the SMTP server from outside without authentication.
0
 
LVL 13

Expert Comment

by:iHadi
ID: 33472943
Hi

use 'ubos.org' instead of 'smtp.ubos.org'
0
 
LVL 1

Author Comment

by:Anthony Matovu
ID: 33473495
I have tried Ihadi's approach and i get message "Unable to read data from the transport connection"

I have tried to understand what to do with robbe's solution and i cannot get through yet. How do i get the server name from outlook, i have failed. true the application is going to run on the local Intranet but i would also want to learn about the alternative methods.

Thanks
0
 
LVL 1

Author Comment

by:Anthony Matovu
ID: 33473599
Thank you It has worked,
I used nslookup on the cmd prompot
and it gave me the server name "filter.ubor.org"

robbe: can i know about the alternative methods and also how to get the name through outlook

I replace this in the code and it worked

Anthony
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
We aren’t perfect, just like everyone else.  Check out the email errors our community caught and learn the top errors every email marketer should avoid.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question