Click or drag to resize

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)
Syntax
public static void Send(
	string pTo,
	string pSubject,
	string pBody,
	string pFrom = "",
	EmailSMTPSetting pSMTPSetting = null
)

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