EmailSend Method |  |
Send a simple email
Namespace:
Velo.Services
Assembly:
Velo.Services (in Velo.Services.dll) Version: 22.2.10.1 (22.2.10.450)
Syntaxpublic static void Send(
string pTo,
string pSubject,
string pBody,
string pFrom = "",
EmailSMTPSetting pSMTPSetting = null
)
Public Shared Sub Send (
pTo As String,
pSubject As String,
pBody As String,
Optional pFrom As String = "",
Optional pSMTPSetting As EmailSMTPSetting = Nothing
)
Parameters
- pTo
- Type: SystemString
Email address to send - pSubject
- Type: SystemString
Title of email - pBody
- Type: SystemString
Email text to send - pFrom (Optional)
- Type: SystemString
Sender email address.
If empty then read email address from application configuration see EmailEmailSetting - pSMTPSetting (Optional)
- Type: Velo.ServicesEmailSMTPSetting
SMTP setting.
If parameter null then read SMTP setting from application configuration.
Examples
Send a simple email
#region --- Preparation ---
string lTo = "fs@sowi.ch";
string lSubject = "Test email";
string lBody = "Test email body";
#endregion
#region --- Execution ---
try
{
Services.Email.Send
(
pTo: lTo,
pSubject: lSubject,
pBody: lBody
);
}
catch (Exception lException)
{
Assert.Fail(lException.Message);
}
#endregion
See Also