ASP.NET how to write code for mail sender? -


i have search many sites. can't understatnd said. refer in internet told create cdo files.

please me send mail in project. have 3 textboxes:

  1. tomail
  2. heading
  3. content of message
  4. send button

use below code sent mail.

            mailmessage mail = new mailmessage();             smtpclient smtpserver = new smtpclient("smtp.gmail.com");              mail.from = new mailaddress("me@mydomain.com");             mail.to.add("u@urdomain.com,rkrishtring@gmail.com");             mail.subject = "report";             mail.body = "this stack overflow using report";             attachment attachment = new attachment(filename);             mail.attachments.add(attachment);              smtpserver.port = 25;             smtpserver.credentials = new system.net.networkcredential("username", "password");             smtpserver.enablessl = true;              smtpserver.send(mail); 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

java - Log4j2 configuration not found when running standalone application builded by shade plugin -

python - How do I create a list index that loops through integers in another list -