test send mail

This commit is contained in:
Suphonchai Phoonsawat 2023-10-15 14:48:54 +07:00
parent 7c1f09bbfc
commit cb988e2e4d
3 changed files with 24 additions and 3 deletions

View file

@ -71,6 +71,11 @@ namespace BMA.EHR.Application.Repositories.Commands
#region " Methods "
public void SendMail()
{
_emailSenderService.SendMail("test", "test", "suphonchai@frappet.com");
}
#region " Private "
#region " List Receiver "

View file

@ -106,6 +106,22 @@ namespace BMA.EHR.Command.Service.Controllers
#region " Methods "
[HttpGet("mail")]
[AllowAnonymous]
public async Task<ActionResult<ResponseObject>> SendMail()
{
try
{
_repository.SendMail();
return Success();
}
catch(Exception ex)
{
return Error(ex);
}
}
#region " Add Watermark "
private void AddWaterMarkText(PdfContentByte pdfData, string watermarkText, BaseFont font, float fontSize, float angle, BaseColor color, Rectangle realPageSize)

View file

@ -37,9 +37,9 @@
},
"Mail": {
"Server": "smtp.gmail.com",
"User": "suphonchai.ph@gmail.com",
"Password": "nnjazjcnwhepkxdm",
"MailFrom": "suphonchai.ph@gmail.com",
"User": "exambkk2@gmail.com",
"Password": "nqruwmgtwfanoccm",
"MailFrom": "exambkk2@gmail.com",
"Port": "587"
},
"API": "https://bma-ehr.frappet.synology.me/api/v1"