Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I had developed an ASP.NET website (C#). I had added the functionality to send mail. But the thing is that I can send mail from very few mail providers like Gmail, rediffmail,live,yahoo by using password. I want to send mail from every mail provider without using password. What should I do?? Please help me.
Posted
Comments
DamithSL 4-Nov-14 4:46am    
you can't, then if I know your email address I can send emails as you sending! is it ok?
S'Aditya 4-Nov-14 4:55am    
I am taking the inputs from user. But I don't want to take the password of his account. And if I declare the smtpserver=smtp.gmail.com then I can send mails form gmail ID only.. What about other IDs??
DamithSL 4-Nov-14 5:02am    
you can send to any other email by using Gamil userid and password but you can't send as someone else without using password of their account.
S'Aditya 4-Nov-14 5:17am    
what should I Do for other IDs??
Richard Deeming 4-Nov-14 6:26am    
You CANNOT send mail from someone else's email account without knowing their credentials. That would be a major security vulnerability.

It doesn't matter how many times you ask, or how you phrase the question; what you are trying to do is IMPOSSIBLE.

yes you can only send it through gmail id
 
Share this answer
 
C#
using System.Web.Mail;

SmtpMail.SmtpServer = "smtp.gmail.com";
                    MailMessage msg = new MailMessage();
                    msg.From = Your Email Id;
                    msg.To = Reciever Id;
                    msg.Subject = "Subject";
                    msg.Body = "BODY OF MAIL
                    msg.Attachments.Add(new MailAttachment(List OF Attachment));
                    try
                    {
                        SmtpMail.Send(msg);
                        MessageBox.Show("Mail has been send");
                    }
 
Share this answer
 
v3
Comments
S'Aditya 4-Nov-14 5:01am    
If I Declare SmtpMail.SmtpServer = "smtp.gmail.com";

Then I can send mails form gmail ID only.. What about other id?? Please help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900