sending mails to other domain

Tags:
C#
Multiple email domains
VB.NET
I want to send the mails that are accumulated in c:inetpubmailrootqueue to a desired user having a mail id such as name@gmail.com or yahoo or any other domain name.Can please guide me the code  in C# or vb.net?

Software/Hardware used:
C# or Vb.net

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Gent01
    Here is the function I use to do this from the code of an individual application: Private Function SendMail(Server As String, User As String, Password As String, Sender As String, Recipient As String, Subject As String, Body As String) AS Boolean Dim client As SmtpClient Dim email As MailMessage email = New MailMessage(Sender, Recipient, Subject, Body) client = New SmtpClient(Server) client.UseDefaultCredentials = False client.Credentials = new NetworkCredential(User, Password) Try client.Send(email) Catch ex As System.Exception 'You'll need some code here to get an error message back to you. Return False End Try Return True End Function If you wanting that will do it for the whole server, that will involve research on Google. If you use the code, you will need to import System.Net and System.Net.Mail
    1,870 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following