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:


Bloco | Campo |
---|---|
From | name_from |
To | name_to |
email_to | |
Message | subject |
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 | |
---|---|
smtp | SMTP server address |
usr | SMTP server user |
pw | SMTP server password |
from | e-mail from – sender |
to | e-mail destination, can be a string or variable containing an e-mail, or a variable containing an e-mail array. |
Subject | Message title |
Message | Message to be sent |
Type | text message type to be sent: “T” for only text or “H” for text and/or html |
copies | e-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 |
Comment this post