How to Send an e-mail with attachment

On this tutorial, Send an email with attachment using the macro sc_mail_send.

1- Create a new control form application

2- Click in New Field.

3- On quantity type 5 and click in Next.

4- Create the fields according to the image below.

5- In the application menu click in Blocks from the Layout folder.

6- Edit theMain Block.

7- Change the block name and label to To

8- Click in Create New Block.

9- Enter the values for the attributes Name, Label and To

10- Change the block name and label to Mensagem

11- Click in Create New Block.

12- Enter the values for the attributes Name, Label and Mensagem

13- Edit the created blocks properties according to the image below.

14- In the application menu click in Select Fields to organize the field according to the table below:

BlocoCampo
Fromname_from
Toname_to
email_to
Messagesubject
text

15- Code in the event OnValidate .

sc_mail_send(smtp, usr, pw, from, to, subject, message, mens_type, copies, copies_type, port, connection_type, attachment)

Atributes
smtpSMTP server address
usrSMTP server user
pwSMTP server password
frome-mail from – sender
toe-mail destination, can be a string or variable containing an e-mail, or a variable containing an e-mail array.
SubjectMessage title
MessageMessage to be sent
Typetext message type to be sent: “T” for only text or “H” for text and/or html
copiese-mail recipient list (optional), can be a string or variable containing one or more e-mails, separated by “;”, or a variable containing an array of e-mails



Tutorials in the same category

Tutorial: Cloud File Management

Some of the data storage services are ready to securely read and store files and images from your S...

Integration with WhatsApp

To integrate WhatsApp with ScriptCase, we will be using a specific API called Chat-API, it is a...

Tutorial: Blank Application

In this example a Blank application will be created, using for example jquery code to create an acc...

Using the Paypal and Pagseguro API

1 - We create an application of the grid type 2 - We edit the following fields and create a ...

Comment this post