本文整理汇总了C#中Functions.SendEmail方法的典型用法代码示例。如果您正苦于以下问题:C# Functions.SendEmail方法的具体用法?C# Functions.SendEmail怎么用?C# Functions.SendEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Functions
的用法示例。
在下文中一共展示了Functions.SendEmail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterUser
public JsonResult RegisterUser(int ClientId, string NameSurname, string Email, string Password, string Phone, string DeviceId, string RawPW, string Address)
{
DeviceUser newUser = new DeviceUser(ClientId, DeviceId, NameSurname, Phone, Email, Password, Address);
Client c = new Client();
ClientRepository cr = new ClientRepository();
c = cr.GetClient(Convert.ToInt32(ClientId));
if (appRep.CheckDeviceUserRegistration(DeviceId, Phone, ClientId.ToString(), Password))
{
newUser.DeviceUserId = -1;
var j = this.Json(newUser);
return Json(j, JsonRequestBehavior.AllowGet);
}
else
{
//* In app, check if the DeviceUserId field != 0 for a successfull registration *//
DeviceUser insertedUser = appRep.AddDeviceUser(newUser);
if (insertedUser.DeviceUserId != 0)
{
Functions f = new Functions();
f.SendEmail("You have been successfully registered. \n Registration details: \n Phone: " + Phone + " \n Password: " + RawPW + "\n\n Please keep this information safe, and do not delete this email.", Email, "Registration Details for: " + c.Name);
//...Send Email to Registrar
//Get Client Service Mail List
List<Settings> mails = setRep.GetSettings("registrar", ClientId);
if (mails.Count >= 1)
{
StringBuilder maillist = new StringBuilder();
foreach (Settings setting in mails)
{
maillist.Append(setting.Value).Append(",");
}
maillist.Remove(maillist.Length - 1, 1);
f.SendEmail("Please Approve:\n"+NameSurname, maillist.ToString(), "Netintercom User Request's Approval");
}
}
var j = this.Json(newUser);
return Json(j, JsonRequestBehavior.AllowGet);
}
}
示例2: RequestService
public ActionResult RequestService(int DeviceUserId, string ServiceRequest, string Query)
{
DeviceUserRepository DevURep = new DeviceUserRepository();
ServicesRepository ServRep = new ServicesRepository();
Services service = new Services();
DeviceUser user = DevURep.GetDeviceUser(DeviceUserId);
service.ClientId = user.ClientId;
service.DeviceUserId = DeviceUserId;
service.Service = ServiceRequest;
service.Query = Query;
service.ModifiedDate = DateTime.Now;
StringBuilder w = new StringBuilder();
w.Append(user.Name).Append(" ").Append(user.Surname).Append("\n");
w.Append("Address: ").Append(user.Address).Append("\n");
w.Append("Contact Details: Phone - ").Append(user.Phone).Append(" Email - ").Append(user.Email).Append("\n");
w.Append("Request: ").Append(service.Service);
w.Append("\n").Append(service.Query);
Services ins = ServRep.AddServices(service);
if (ins.ServiceId != 0)
{
//Send email
Functions f = new Functions();
//Get Client Service Mail List
List<Settings> mails = setRep.GetSettings("email", user.ClientId);
if (mails.Count >= 1)
{
StringBuilder maillist = new StringBuilder();
foreach (Settings setting in mails)
{
maillist.Append(setting.Value).Append(",");
}
maillist.Remove(maillist.Length - 1, 1);
f.SendEmail(w.ToString(), maillist.ToString(), service.Service);
}
return Content("Success", "text/html");
}
else
{
return Content("Fail", "text/html");
}
}
示例3: Mail
public ActionResult Mail(FormCollection form)
{
Functions f = new Functions();
string message = "Someone did something wrong";
if (form.AllKeys.Count() > 3)
{
message = "Name: " + form["name"].ToString() + "\nEmail: " + form["email"].ToString() + "\nWebsite: " + form["website"].ToString() + "\n\nMessage:\n" + form["message"].ToString();
}
f.SendEmail(message, Constants.ContactUsEmail, "Netintercom [Web Request]");
return RedirectToAction("Index");
}