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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:55:22+00:00 2026-06-12T13:55:22+00:00

I am facing very confusing problem. In my website all user have there own

  • 0

I am facing very confusing problem.

In my website all user have there own mail box which can be seen by them when they log in.

I have not assigned then any ids like 123@gmail.com or anything else.

They can send mails to each-other through their names only.

When they send a mail to diffrent user, it is saved as a data row in the database with the help of personid.

Now i want that if a user sends a mail to one other user, it should also automatically send a notification mail to the receiver’s external mail id.

I found the related code like

MailMessage mail = new MailMessage();
                    mail.To.Add("hiral@yahoo.com");
                    mail.From = new MailAddress("hiral@gmail.com");
                    mail.Subject = "Send Email by asp.net code using google or gmail smtp server";
                    string Body = "Hi, I am testing Email function in asp.net";
                    mail.Body = Body;

                    SmtpClient smtp = new SmtpClient("localhost", 25);
                    smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address  
                    smtp.Credentials = new System.Net.NetworkCredential
                         ("hiral@gmail.com", "xxxxxxxxxxxxxx");
                    //Or your Smtp Email ID and Password  
                    smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
                    smtp.EnableSsl = true;
                    smtp.Send(mail);
                    lblsuccess.Visible = true; 

It is working perfectly for me now..

Now i need to change the send field in

mail.From = new MailAddress("hiral@gmail.com");

Because it can be any user without any email id like this.

What can i do for this..?

  • 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-06-12T13:55:24+00:00Added an answer on June 12, 2026 at 1:55 pm

    Retrieve the person/sender information from database by personid then put it on a variable list.

    private class senderInformation{
    
     private string lastname;
     private string firstname;
     private string email;
    
    }
    
    senderInformation person = new senderInformation();
    
    person.lastname = "Smith";
    person.firstname = "John";
    person.email= "john@gmail.com";
    
    mail.From = new MailAddress(person.email.toString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing very strange problem in which I have byte[] and when I
I am facing a very strange problem. I have a grid and when i
I am facing a very annoying problem. I have written (in Notepad++) some SQL
I am facing a very interesting problem. I have tested the Delay job gem
I am facing a very regular scenario. I have an NSArray which has object
I'm facing a very strange problem in my ASP.NET Application. When the user clicks
I am facing a very basic problem. Some time small things can take your
I'm facing a probleme very disturbing. I have a jsp, which display a form
I facing very huge problem now, that is I have usercontrol (created by me)
I am facing this very weird problem, I have created a custom UITableViewCell on

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.