quarta-feira, 19 de agosto de 2020

DICAS 3039 - WINDEV TUTORIAL 62 - ENVIAR EMAIL - MELHORIAS - PARTE C



https://youtu.be/t8uWJMdutNo


Bom Dia/Boa Tarde/Boa Noite


Esse Ao Vivo vai estrear as 11:00 do dia 29/08/2020 

DICAS 3039 - WINDEV TUTORIAL 62 - ENVIAR EMAIL - MELHORIAS - PARTE C 
Tutoriel WINDEV : Leçon 4.9.c. Envoyer un email - Améliorations

ASSUNTOS

EXPLICANDO O QUE SERA FEITO NESSA LICAO
ANCORANDO OS CAMPOS
EXPLICANDO F5 - ORDENS DOS CAMPOS 
ACRESCENTAR BOTAO FECHAR
ACRESCENTAR MENU OPCAO PARA CHAMAR EMAIL
ABRINDO EMAIL JANELA NAO MODAL
  OpenChild
    smtp.gmail.com
    25 / 587 
TESTE DE EMAIL 
 

Video original da Franca

https://youtu.be/mcNnQ3hditQ


Playlist Windev TUTORIAL

=============================================


// BTN ENVIAR

// WLanguage code for opening the connection and starting the SMTP session:
// Código WLanguage para abrir a conexão e iniciar a sessão SMTP

minha_sessao is emailSMTPSession
minha_sessao..Name=EDT_USUARIO
minha_sessao..Password=EDT_SENHA
minha_sessao..ServerAddress=EDT_SERVIDOR_SMPT
minha_sessao..Port=EDT_PORTA
//INICIO - SE FOR GMAIL VAMOS ACRESCENTAR
IF CBOX_Gmail=True THEN
   minha_sessao..Option=emailOptionSecuredTLS
END
//FIM - SE FOR GMAIL VAMOS ACRESCENTAR
// vamos comecar sessao smtp
IF NOT EmailStartSession(minha_sessao) THEN
Error("conexao smpt"+ErrorInfo)
RETURN
END

// Código WLanguage para preparar o e-mail
MINHA_MENSAGEM is Email 
MINHA_MENSAGEM..Sender=EDT_Email_Remetente
MINHA_MENSAGEM..Subject=EDT_ASSUNTO
MINHA_MENSAGEM..HTML=EDT_CONTEUDO
MINHA_MENSAGEM..Message=HTMLToText(EDT_CONTEUDO)
// VAMOS ADICIONAR O DESTINATARIO
Add(MINHA_MENSAGEM..Recipient,COMBO_destinatario..DisplayedValue)
// VAMOS ADICIONAR ANEXO 
IF EDT_ANEXO<>"" THEN
EmailLoadAttachment(MINHA_MENSAGEM,EDT_ANEXO)
END

// Código WLanguage para enviar o e-mail

IF EmailSendMessage(minha_sessao,MINHA_MENSAGEM)=False THEN
Error("ERRO EMAIL NAO ENVIADO",ErrorInfo())
ELSE
//MENSAGEM ENVIADA
ToastDisplay("MENSAGEM ENVIADA COM SUCESSO",toastShort,vaMiddle,haCenter)
END

// Código WLanguage para fechar a sessão SMTP

EmailCloseSession(minha_sessao)

















Window improvements
We are going to improve our window:
  • Add a Button control to close the window.
  • Format the window via the management of anchors and the tab order.
  • Start the window from the "WIN_Menu" window.

Closing the window

  • To add a Button control to close the window:
    1. On the "Creation" pane, in the "Usual controls", expand "Button": the list of preset buttons is displayed.
    2. Click the "Close" button.
    3. Click the position in the window where the control must be created (for example at the bottom, to the right of the "Send" Button control).

Formatting

  • To define the anchors:
    • Select the "Sender", "Recipient" and "Subject" controls: these controls must be anchored in width.
    • Select the "HTML text" control: this control must be anchored in width and in height.
    • Select the Button controls: these controls must be anchored to the right and at the bottom.
    • Select the control for file selection: this control must be anchored in width and at the bottom.
  • To define the tab order:

    Remark

    The tab order of controls is the order in which the user can type the values in the different window controls. At runtime, the Tab key allows switching from one control to another. The default tab order corresponds to the creation order of controls. It can be modified:
    • by specifying an automatic tab order: the first control in edit will be the control found in the top left corner of window, the second one will be the one found immediately to its right or below...
    • by specifying a tab order by selection.
    1. Display the tab order by pressing F5.
    2. Define the automatic tab order: on the "Window" pane, in the "Order" group, expand "Tab order" and select "Define automatically".
    3. The numbers are modified and they now appear in order.
      Tab order
    4. Press F5 again to hide the numbers.
    5. Save the window ( Save an element or Ctrl + S).

Non-modal opening of window

The window for email management will be opened from the "WIN_Menu" window. Its opening mode is specific because this window must not prevent the information displayed in the "WIN_Menu" window from being viewed.
  • To open the "WIN_Sending_an_email" window from the "WIN_MENU" window:
    1. Open "WIN_Menu" in the editor (double-click its name in the "Project explorer" pane, for example).
    2. In the editor, expand the "Menu" option and select "Exit".
    3. Open the popup menu of the "Exit" option (right click) and select "Add before".
    4. Type the option caption ("Send an email") and validate.
    5. Select the "Exit" option again.
    6. Open the popup menu of the "Exit" option (right click) and select "Insert a separator".
    7. Open the popup menu of the "Send an email" option (right click) and select "Code".
    8. Write the following WLanguage code:
      // Opens the window for sending emails
      OpenChild(WIN_Sending_an_email)
      In this WLanguage code, OpenChild is used to open the window in "non-modal" mode: the user will be able to write an email and to see the information displayed in the main window at the same time.
  • Save the window and its code ( Save an element or Ctrl + S).
  • Run the project test ( Run project test among the quick access buttons) and open the window for sending emails via "Menu .. Send an email".
    Email send test

DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C






Nenhum comentário:

Postar um comentário

Teste

Teste
teste