Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7702017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:07:46+00:00 2026-05-31T23:07:46+00:00

I wrote some codes so as to send e mail but I can only

  • 0

I wrote some codes so as to send e mail but I can only send mail from gmail account to gmail account also, I want to use hotmail accounts how can i do it? thanks
It is

SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
mail.From = new MailAddress("xxx@gmail.com");
mail.To.Add("kalaylevent@gmail.com");
mail.Subject = "Test Mail - 1";
mail.IsBodyHtml = true;
string htmlBody;
htmlBody = "Write some HTML code here";
mail.Body = htmlBody;
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("kalaylevent@gmail.com", "mypassword");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:07:47+00:00Added an answer on May 31, 2026 at 11:07 pm

    I changed a little of code and it tested successfully (from Hotmail to Gmail)

    SmtpClient SmtpServer = new SmtpClient("smtp.live.com");
    var mail = new MailMessage();
    mail.From = new MailAddress("youremail@hotmail.com");
    mail.To.Add("to@gmail.com");
    mail.Subject = "Test Mail - 1";
    mail.IsBodyHtml = true;
    string htmlBody;
    htmlBody = "Write some HTML code here";
    mail.Body = htmlBody;
    SmtpServer.Port = 587;
    SmtpServer.UseDefaultCredentials = false;
    SmtpServer.Credentials = new System.Net.NetworkCredential("youremail@hotmail.com", "password");
    SmtpServer.EnableSsl = true;
    SmtpServer.Send(mail);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote some code to send an email from my PHP script using PHPMailer.
I want to reuse some code I wrote to add some functionality to a
I wrote some code to send email as both HTML & Text, and I
In my web application i've got an iframe from different domain. I wrote some
Need some help to write a C# code to send mail to multiple users
So, I wrote some JavaScript to grab an xml file from my desktop and
I just wrote php daemon for my app and want to implement some output
I wrote some native methods in a vc++ with JNI to be accessed from
I'm planning to send emails from inside of VIM via SendEmail , but I
I am interested in doing some snail mail based surveys but I am looking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.