1. Ce site utilise des cookies. En continuant à utiliser ce site, vous acceptez l'utilisation des cookies. En savoir plus.
  2. Bonjour tout le monde ! Veillez consulter la Politique de forum pour comprendre nos règles, Merci a vous !
    Rejeter la notice

Not able to send email by windev (through gmail)

Discussion dans 'Windev' créé par sanyad, Avr 16, 2020.

  1. sanyad

    sanyad Member

    Inscrit:
    Sept 27, 2019
    Messages:
    176
    J'aime reçus:
    7
    Dear

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    ... Thanks a lot. You saved my day. Now working... Code is same as written above. I enabled 2-step protection and generated app specific code & further use that code as password .... Its working well. Thanks a lot.
     
  2. sanyad

    sanyad Member

    Inscrit:
    Sept 27, 2019
    Messages:
    176
    J'aime reçus:
    7
    MyEmail is an Email
    MySession is an emailSessionSMTP
    MyAttach is an emailAttach

    MyEmail..Sender= "Gmail_from_which_mail_to_be_send"
    MyEmail..Recipient[1] = "Receipient_Emil-Address"
    MyEmail..SenderAddress = "Gmail_from_which_mail_to_be_send"
    MyEmail..Subject = "Subject"
    MyEmail..Message = "Message"



    MySession..ServerAddress ="smtp.gmail.com"
    MySession..Password ="generated password from Gmail - for 3rd party app. Enabled 2-step protection & generate password"
    MySession..Name = "Gmail_from_which_mail_to_be_send"
    MySession..Port = 587
    MySession..Option= emailOptionSecuredTLS

    IF NOT EmailStartSession (MySession) THEN
    IF ErrorOccurred THEN
    Error ((errFullDetails))
    END
    END

    IF EmailSendMessage ( MySession, MyEmail, emailOptionEncodeHeader) THEN
    EmailCloseSession (MySession)
    Info ( "Mail sent ) ")

    ELSE
    EmailCloseSession (MySession)
    Error (ErrorInfo (errFullDetails))
    END
     

Partager cette page

Chargement...