This commit is contained in:
2020-07-03 22:50:33 +00:00
parent efa0f02137
commit 510c4120f8
10 changed files with 59 additions and 622 deletions

View File

@@ -15,23 +15,30 @@ using Microsoft.Extensions.Configuration;
namespace contact.Pages
{
[BindProperties(SupportsGet = true)]
public class ContactFormModel
{
public ContactFormModel()
{
DbId = "n/a v7";
}
[Required]
public string Name { get; set; }
[Required]
public string Company { get; set; }
[BindProperty(SupportsGet = true)]
public string DbId { get; set; }
[Required, EmailAddress]
public string Email { get; set; }
[Required]
public string Message { get; set; }
}
public class ContactModel : PageModel
{
public string Message { get; set; }
[BindProperty]
[BindProperty(SupportsGet = true)]
public ContactFormModel Contact { get; set; }
private readonly IConfiguration _configuration;
@@ -71,7 +78,7 @@ namespace contact.Pages
private void SendMail()
{
var MessageBody = $"Name:\r\n{Contact.Name}\r\n\r\nCompany:\r\n{Contact.Company}\r\n\r\nMessage:\r\n{Contact.Message}";
var MessageBody = $"Name:\r\n{Contact.Name}\r\n\r\nCompany:\r\n{Contact.Company}\r\n\r\nDatabase Id:\r\n{Contact.DbId}\r\n\r\nMessage:\r\n{Contact.Message}";
//SEND TO US
using (var message = new MailMessage())