本文整理汇总了C#中Email.sendEmail方法的典型用法代码示例。如果您正苦于以下问题:C# Email.sendEmail方法的具体用法?C# Email.sendEmail怎么用?C# Email.sendEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Email
的用法示例。
在下文中一共展示了Email.sendEmail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: pin
private void pin()
{
Boolean printTicket = false;
Boolean goBack = true;
int amount = 0;
String input;
String dispenserCommand = "00,00,00,*";
cancelled = false;
while (goBack == true)
{
pinsherm.Show();
while (true)
{
input = arduino.getString();
if (input.Contains("1"))
{
amount = 10;
break;
}
else if (input.Contains("2"))
{
amount = 20;
break;
}
else if (input.Contains("3"))
{
amount = 50;
break;
}
else if (input.Contains("4"))
{
amount = getAlternativeAmount();
break;
}
else if (input.Contains("#"))
{
cancelled = true;
break;
}
else if (input.Contains("C"))
{
cancelled = true;
endOfSession = false;
break;
}
}
pinsherm.Hide();
if ((amount > saldo && amount != 0) || amount >= 200)
{
PinError pinError = new PinError();
cancelled = true;
}
if (cancelled == true)
{
break;
}
if (amount == 10 && stock.checkIfAvailable(1, 0 , 0) == true)
{
dispenserCommand = "01,00,00,*";
}
else if(amount == 10)
{
BiljetScreen selector = new BiljetScreen();
selector.showInsufficient();
cancelled = true;
}
if (amount > 10)
{
dispenserCommand = biljetSelection(amount);
if (dispenserCommand.Equals("00,00,00,*"))
{
cancelled = true;
break;
}
}
if (cancelled == true) { break; }
uploadConnection.UpdateBalans(rekeningID, (saldo - amount*100));
uploadConnection.transaction(pasID, rekeningID, amount);
asker.Show();
while (true)
{
input = arduino.getString();
if (input.Contains("*"))
{
printTicket = true;
goBack = false;
break;
}
else if (input.Contains("#"))
{
goBack = false;
break;
}
else if (input.Contains("A"))
{
Email mailer = new Email(userName, amount, rekeningID,klantID);
mailer.sendEmail();
goBack = false;
break;
//.........这里部分代码省略.........
示例2: btnForget_Click
protected void btnForget_Click(object sender, EventArgs ev)
{
using (ModelTutor obj = new ModelTutor())
{
if (cbWho.SelectedValue == "1")
{
string email = txtEmail.Text.Trim();
var result = (from e in obj.tblStudents
where e.Email == email
select e).Count();
if (result == 1)
{
// sent mail
Email m = new Email();
try
{
var pass = (from e in obj.tblStudents
where e.Email == email
select e.Password).First();
string body = "Your Email is : " + email + " and your password is : " + pass;
m.sendEmail(email, body);
Label1.Text = "Email has been sent to you.";
txtEmail.Text = "";
}
catch (Exception)
{
Label1.Text = "Email sending failed";
}
}
else
Label1.Text = "Enter valid email";
}
else
{
string email = txtEmail.Text.Trim();
var result = (from e in obj.tblTutors
where e.Email == email
select e).Count();
if (result == 1)
{
Email m = new Email();
try
{
var pass = (from e in obj.tblTutors
where e.Email == email
select e.Password).First();
string body = "Your Email is : " + email + " and your password is : " + pass;
m.sendEmail(email, body);
Label1.Text = "Email has been sent to you.";
txtEmail.Text = "";
}
catch (Exception)
{
Label1.Text = "Email sending failed";
}
}
else
Label1.Text = "Enter valid email";
}
}
}
示例3: btnRegister_Click
protected void btnRegister_Click(object sender, EventArgs ev)
{
if (checkValidation())
{
using (ModelTutor obj = new ModelTutor())
{
string email = txtEmail.Text.Trim();
var result = (from e in obj.tblTutors
where e.Email == email
select e).Count();
if (result < 1)
{
tblTutor newTutor = new tblTutor { Id = txtStudentId.Text.Trim(), Name = txtName.Text.Trim(), Email = txtEmail.Text.Trim(), Password = txtPassword.Text.Trim(), Active = true };
obj.AddTotblTutors(newTutor);
#region AddCourses
if (cbCourse1.SelectedValue != "0")
{
obj.AddTotblTutorCourses(new tblTutorCourse { TutorId = newTutor.TutorId, CourseId = Convert.ToInt32(cbCourse1.SelectedValue), Grade = txtGrade1.Text.Trim(), Active = false });
}
if (cbCourse2.SelectedValue != "0")
{
obj.AddTotblTutorCourses(new tblTutorCourse { TutorId = newTutor.TutorId, CourseId = Convert.ToInt32(cbCourse2.SelectedValue), Grade = txtGrade2.Text.Trim(), Active = false });
}
if (cbCourse3.SelectedValue != "0")
{
obj.AddTotblTutorCourses(new tblTutorCourse { TutorId = newTutor.TutorId, CourseId = Convert.ToInt32(cbCourse3.SelectedValue), Grade = txtGrade3.Text.Trim(), Active = false });
}
if (cbCourse4.SelectedValue != "0")
{
obj.AddTotblTutorCourses(new tblTutorCourse { TutorId = newTutor.TutorId, CourseId = Convert.ToInt32(cbCourse4.SelectedValue), Grade = txtGrade4.Text.Trim(), Active = false });
}
#endregion
#region Schedule
string mon = cbMonStart.SelectedValue + "to" + cbMonEnd.SelectedValue;
string tue = cbTueStart.SelectedValue + "to" + cbTueEnd.SelectedValue;
string wed = cbWedStart.SelectedValue + "to" + cbWedEnd.SelectedValue;
string thur = cbThurStart.SelectedValue + "to" + cbThurEnd.SelectedValue;
string fri = cbFriStart.SelectedValue + "to" + cbFriEnd.SelectedValue;
obj.AddTotblSchedules(new tblSchedule { TutorId = newTutor.TutorId, Mo = mon, Tu = tue, We = wed, Th = thur, Fr = fri });
#endregion
try
{
obj.SaveChanges();
Email m = new Email();
try
{
string body = "Hello " + txtName.Text.Trim() + ",\n" + "You are registered for Tutoring.";
m.sendEmail(email, body);
}
catch (Exception)
{
}
Response.Redirect("~/Sucess.aspx?m=Your account has been sucessfuly registered. Login to book tutor.");
}
catch (Exception)
{
}
}
else
{
Label1.Text = "Email already exist";
}
}
}
}