Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Encrypting password for email
#19
As an alternative, can use C# to send email.

from http://stackoverflow.com/a/32336/2547338

Macro C# send email
Code:
Copy      Help
CsFunc("" "password" "to@example.com" "Subject" "Body")


#ret
//C# code
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("xxx@gmail.com", "From Name");
var toAddress = new MailAddress(email);

var smtp = new SmtpClient
{
;;;;Host = "smtp.gmail.com",
;;;;Port = 587,
;;;;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);
}
}
}

But this will not work on Windows 2000. Also on XP without .NET.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)