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' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -