01-04-2017, 04:35 PM
Macro Macro2728
Now you can encrypt the macro. In Options -> Security.
Here i changed email addresses, to avoid more spam.
str CSharpCode=
;using System;
;using System.Net;
;using System.Net.Mail;
;
;public class Email
;{
;static public void Send(string password, string email, string subject, string body)
;{
;var fromAddress = new MailAddress("[email protected]", "From Name");
;var toAddress = new MailAddress(email);
;
;var smtp = new SmtpClient
;{
;;;;;Host = "smtp-mail.outlook.com",
;;;;;Port = 25,
;;;;;EnableSsl = true,
;;;;;DeliveryMethod = SmtpDeliveryMethod.Network,
;;;;;UseDefaultCredentials = false,
;;;;;Credentials = new NetworkCredential(fromAddress.Address, password)
;};
;using (var message = new MailMessage(fromAddress, toAddress)
;{
;;;;;Subject = subject,
;;;;;Body = body
;})
;{
;;;;;smtp.Send(message);
;}
;}
;}
CsFunc(CSharpCode "password" "[email protected]" "Subject" "Body")
Now you can encrypt the macro. In Options -> Security.
Here i changed email addresses, to avoid more spam.