Send Mail (Extended Method)

API Type

Web Services

Description

Sends an email through AgilePoint Server. The extended method enables you to send attachments.

Syntax

public virtual void SendMailEx(String From, String To, String CC, String Subject, String Body , String Attachments)

Parameters

Name Description

From

Definition:
Specifies the From portion of an email.
Type
string
Allowed Values:
A string that includes one or more email addresses in SMTP format.

To

Definition:
Specifies the To portion of an email.
Type
string
Allowed Values:
A string that includes one or more email addresses in SMTP format.

CC

Definition:
Specifies the CC portion of an email.
Type
string
Allowed Values:
A string that includes one or more email addresses in SMTP format.

Subject

Definition:
The subject of an email.
Type
string
Allowed Values:
A single line of text.

Attachments

Definition:
File attachments included with the email.
Type
string
Allowed Values:
A valid path and file name on the AgilePoint Server.

This parameter must use a file path from the file system (for example, C:\file.txt) on the machine where AgilePoint Server is installed.

If there is no attachment, you can pass null or String.Empty.

Output

None.

Example

//Sample for using Workflow.SendMailEx
IWFWorkflowService svc = GetWorkflowService();

try
	{
    string From = "john@tusca.com"; // or <Full Name>"email address"
    string To = "bill@tusca.com";
    string CC = "bob@tusca.com";
    string Subject = "Mail Subject";
    string Body = "Mail Body";
    string Attachments = "c:\\Temp\\Tempdoc.doc";
 
    //Send Mail
    svc.SendMailEx(From, To, CC, Subject, Body, Attachments);
	}

catch (Exception ex)
	{
    Console.WriteLine("Failed! " + ShUtil.GetSoapMessage(ex));
	}

Supported Versions

4.6 and higher