This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user