[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

sending an email through my application

Posted on 2010-08-19
4
Medium Priority
?
287 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Pop culture is prime bait for hackers seeking to infect user’s computers and mobile devices with malicious malware. Hackers know exactly what the latest trends are online and know how to use them to their advantage.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
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

649 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