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 7085239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:24:00+00:00 2026-05-28T07:24:00+00:00

Hi I want to send password validation to my users using c#, and I

  • 0

Hi I want to send password validation to my users using c#, and I wish to protect my mail box getting spammed. How do I do that?

Been trying to this and it’s not working:

SmtpClient smtpClient = new SmtpClient("smtp.gmail.com", 587);
smtpClient.EnableSsl = true;

smtpClient.Timeout = 10000;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = new NetworkCredential("login", "password");

MailMessage mailMsg = new MailMessage();
mailMsg.From = new MailAddress("noreply@mysite.com");
mailMsg.To.Add("user");
mailMsg.CC.Add("cc@ccServer.com");
mailMsg.Bcc.Add("bcc@bccServer.com");
mailMsg.Subject = "Subject";
mailMsg.Body = "BodyOfTheMailString";
smtpClient.Send(mailMsg); 
Console.WriteLine("Mail sent");

The user i am sending this email to, getting my gmail account as the sender

  • 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-28T07:24:01+00:00Added an answer on May 28, 2026 at 7:24 am

    This is not C#’s task, neither the body of your message: its your mailbox configuration.

    If this is just for email validation, you can always create a new email like “service@domain.com” or “noreply@domain.com” for sending these verifications messages and then set this mailbox to ignore incoming messages.

    Also if you try to send messages using emails that are not registered into your server, the server can deny your request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I want to send attachment with mail using javaMailAPI. my code is: public
I want to send emails to users when the forget their passwords that prompt
I want to be able to send a password reset email using django.contrib.auth.views.password_reset but
I want to send mail using sendmail to multiple recipients in single call. I
For testing purposes I want send mail to my localhost user account rather than
I want so send every week an update by email. But Im afraid that
I want to send a password email to a user, however the customer wants
i want to send xml file with userid and password over HTTPs and then
I want to send mail in my website. Also, want to make MailMessage.From property
Here's a scenario; I want to send email using PHP and Zend Framework. Here's

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.