Я пишу синтаксис бритвы для веб-страниц.Моя проблема в том, что у меня есть таблица, содержащая адрес электронной почты сотрудника, и я хочу отправить им электронное письмо после нажатия на любое из их имен в поле формы.
Вот что я пробовал до сих пор:
// Initialize WebMail helper
WebMail.SmtpServer = "smtp.office365.com";
WebMail.SmtpPort = 25;
WebMail.UserName = "";
WebMail.Password = "";
WebMail.From = "";
WebMail.EnableSsl = true;
//i want to send a message to an email
WebMail.Send(to: Email,
subject: "Visitor Alert",
body: " From: <br/> " + "Name: " + full_name + "<br/> " + " Mobile Number: "
+ phone_number + "<br/> " + " Address :" + address);
//this is html part
<div class="form-group">
@{
var data = "SELECT FullName,Email From Employee ORDER BY Email";
var DB = Database.Open("VisitorConnectionString").Query(data);
<label>Whom to See</label>
<select class="form-control">
<option>---Select Staff---</option>
//here was to populate the name of the employees from database
@foreach (var item in DB)
{
<option name="Email" value="@item.FullName">@item.FUllName</option>
}
</select>
}