Methoden Überlagerung sortiert
This commit is contained in:
@@ -88,10 +88,10 @@ namespace BeWo.Service.Core
|
||||
|
||||
public static bool SendMail(string subject, string body, string toAddress)
|
||||
{
|
||||
return SendMail(null, null, subject, body, toAddress);
|
||||
return SendMail(subject, body, toAddress, null, null);
|
||||
}
|
||||
|
||||
public static bool SendMail(string senderName, string senderEMail, string subject, string body, string toAddress)
|
||||
public static bool SendMail(string subject , string body, string toAddress, string senderName, string senderEMail)
|
||||
{
|
||||
var server = ConfigurationManager.AppSettings.Get("SmptServer");
|
||||
var user = ConfigurationManager.AppSettings.Get("SmtpUser");
|
||||
@@ -114,27 +114,28 @@ namespace BeWo.Service.Core
|
||||
var body2 = "Kunde: " + MultitenancyOperationContextExt.Current.Tenant;
|
||||
//body2 += "\r\nIP: " + GetClientIP();
|
||||
body += "\n\n" + body2;
|
||||
//}
|
||||
//}
|
||||
|
||||
|
||||
|
||||
//if (to.Equals())
|
||||
|
||||
return SendMail(senderEMail.Trim(), senderName, to, subject, body, server, user, pass, sendAsync);
|
||||
|
||||
}
|
||||
senderEMail = senderEMail.Trim();
|
||||
|
||||
public static bool SendMail(string fromEMail, string fromName, string to, string subject, string body, string smtpServer, string smtpUser, string smtpPassword, bool sendAsync)
|
||||
return SendMail(subject, body, to, senderName, senderEMail, server, user, pass, sendAsync);
|
||||
}
|
||||
|
||||
public static bool SendMail(string subject, string body, string toAddress, string senderName, string senderEMail, string smtpServer, string smtpUser, string smtpPassword, bool sendAsync)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!IsValidEmail(to) || !IsValidEmail(fromEMail))
|
||||
if (!IsValidEmail(toAddress) || !IsValidEmail(senderEMail))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
String from = fromEMail;
|
||||
String from = senderEMail;
|
||||
|
||||
if (to.Equals("support@bewoplaner.de"))
|
||||
if (toAddress.Equals("support@bewoplaner.de"))
|
||||
{
|
||||
var supportSenderMail = ConfigurationManager.AppSettings.Get("SupportSenderEMail");
|
||||
if (String.IsNullOrEmpty(supportSenderMail))
|
||||
@@ -146,20 +147,20 @@ namespace BeWo.Service.Core
|
||||
|
||||
|
||||
MailMessage message = null;
|
||||
if (String.IsNullOrEmpty(fromName))
|
||||
message = new MailMessage(from, to, subject, body);
|
||||
if (String.IsNullOrEmpty(senderName))
|
||||
message = new MailMessage(from, toAddress, subject, body);
|
||||
else
|
||||
{
|
||||
MailAddress fromMailAddress = new MailAddress(from);
|
||||
MailAddress toMailAddress = new MailAddress(to);
|
||||
MailAddress toMailAddress = new MailAddress(toAddress);
|
||||
|
||||
message = new MailMessage(fromMailAddress, toMailAddress);
|
||||
message.Subject = subject;
|
||||
message.Body = body;
|
||||
}
|
||||
if (fromEMail != from)
|
||||
if (senderEMail != from)
|
||||
{
|
||||
message.ReplyToList.Add(new MailAddress(fromEMail, fromName));
|
||||
message.ReplyToList.Add(new MailAddress(senderEMail, senderName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
|
||||
}
|
||||
return Utils.SendMail(senderName, senderEMail, subject, body, null);
|
||||
return Utils.SendMail(subject, body, null, senderName, senderEMail);
|
||||
}
|
||||
|
||||
private MailDC CreateMailDC(Mail2Receiver m2r)
|
||||
|
||||
Reference in New Issue
Block a user