The sendEmail method is an example of how to programmatically send emails using C#. It demonstrates the usage of the System.Net.Mail namespace to create and send an email with an attachment. The method assumes the use of an SMTP server for sending the email.

public void sendEmail()  
{  
    String userName = "[email protected]";  
    String password = "password for from address";  
    MailMessage msg = new MailMessage("[email protected] ", " [email protected] ");  
    msg.Subject = "Your Subject Name";  
    StringBuilder sb = new StringBuilder();  
    sb.AppendLine("Name: " + txtname.Text);  
    sb.AppendLine("Mobile Number: " + txtmbno.Text);  
    sb.AppendLine("Email:" + txtemail.Text);  
    sb.AppendLine("Drop Downlist Name:" + ddllinksource.SelectedValue.ToString());  
    msg.Body = sb.ToString();  
    Attachment attach = new Attachment(Server.MapPath("Folder/" + ImgName));  
    msg.Attachments.Add(attach);  
    SmtpClient SmtpClient = new SmtpClient();  
    SmtpClient.Credentials = new System.Net.NetworkCredential(userName, password);
    SmtpClient.Port = 587;   
    SmtpClient.Host = "smtp.office365.com"; 
    SmtpClient.EnableSsl = true;  
    SmtpClient.Send(objMailMessage);  
}  

Email Credentials

Creating the Mail Message

Adding an Attachment

Configuring the SMTP Client

Sending the Email

Conclusion

The sendEmail method provides a basic understanding of how to send emails with attachments in C#. However, for production-level code, enhancements like secure credential storage, dynamic SMTP settings, and comprehensive error handling are crucial. Additionally, it's important to correct the typo in the Send method call.