Grasshopper

algorithmic modeling for Rhino

Just for fun,

 

anyone have idea how to send email from GH.

 

Cheers

VL

Views: 945

Replies to This Discussion

It's very difficult to send email from software, precisely because that's how Spammers send spam. If however you have a mail-server you can use and proper passwords, then have a look at the System.Web.Mail namespace, it should be relatively simple to use the MailMessage class.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Creating an email is easy. Sending an email isn't difficult, but requires that you know the smtp address and are able to provide the propert credentials. The following code is going to let you know what classes you need to work with, but isn't really going to help you all that much with getting the correct details to actually send the email. Sometimes, depending on how your network/domain/email account is set up, you may be able to send email without providing a ton of those details.

System.Net.Mail.MailMessage anEmail = new System.Net.Mail.MailMessage();
anEmail.From = "me@here.com";
anEmail.To = "you@there.com";
anEmail.Subject = "A Test Email";
anEmail.Body = "Just some text that will be the body of the email.";

System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient();
client.Host = "smtp.yourmailhost.com";
client.Send(anEmail);

Dear David and Damien,

 

Thanks for the reply, a parametric spammer sounds cool but, yea, I have a mail server, so I might be able to give it a try.

 

Thanks for the code.

 

Victor

 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service