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

x
?
Solved

Email in VB.Net - need the value for  the client.Host

Posted on 2010-09-22
2
Medium Priority
?
542 Views
Last Modified: 2012-05-10
I am running a VB.Net application and need to send emails on server "123.12.123.1234" using the domain "RRRR.info".
My email sever is on a different server the domain is "QQQQ.info"
I downloaded an email example from Microsoft. The code is below.
Question: What should I put as the value for the client.Host = "XXXXXXXX"
Thanks

        Public Shared Sub SendMessage(ByVal subject As String, ByVal messageBody As String, _
            ByVal fromAddress As String, ByVal toAddress As String, ByVal ccAddress As String)

            Dim message As New MailMessage()
            Dim client As New SmtpClient()

            'Set the sender's address
            message.From = New MailAddress(fromAddress)

            'Allow multiple "To" addresses to be separated by a semi-colon
            If (toAddress.Trim.Length > 0) Then
                For Each addr As String In toAddress.Split(";"c)
                    message.To.Add(New MailAddress(addr))
                Next
            End If

            'Allow multiple "Cc" addresses to be separated by a semi-colon
            If (ccAddress.Trim.Length > 0) Then
                For Each addr As String In ccAddress.Split(";"c)
                    message.CC.Add(New MailAddress(addr))
                Next
            End If

            'Set the subject and message body text
            message.Subject = subject
            message.Body = messageBody

            'TODO: *** Modify for your SMTP server ***
            'Set the SMTP server to be used to send the message
            client.Host = "XXXXXXXX"

            'Send the e-mail message
            client.Send(message)
        End Sub
0
Comment
Question by:n2dweb
[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
2 Comments
 
LVL 1

Accepted Solution

by:
Neogeta earned 2000 total points
ID: 33739478
XXXXXXXX should be either the ip address of the mail server you are trying to send the email to..
EG:
If I was sending mail from mail server "boris" which had the IP of 192.168.10.12 that would be the client.host I'd be sending mail from.

I hope that helps.
David
0
 
LVL 1

Expert Comment

by:Neogeta
ID: 33739709
I'm glad it worked out for you.
Take Care
David
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

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