E-design
Advanced Member level 5
sending email from a c program
I need to send a message as soon as a simple C program produced a wanted result. I need to include the value of a variable in the email message. I am not sure how to go about this. Please help.
I found this on Google but it won't compile with an error about MailMessage mail and there's no method to attach a value in the message.
I need to send a message as soon as a simple C program produced a wanted result. I need to include the value of a variable in the email message. I am not sure how to go about this. Please help.
I found this on Google but it won't compile with an error about MailMessage mail and there's no method to attach a value in the message.
Code:
// create mail message object
MailMessage mail = new MailMessage();
mail.From = " "; // put the from address here
mail.To = " "; // put to address here
mail.Subject = " "; // put subject here
mail.Body = " "; // put body of email here
SmtpMail.SmtpServer = " "; // put smtp server you will use here
// and then send the mail
SmtpMail.Send(mail);