New question #697175 on SikuliX:
https://answers.launchpad.net/sikuli/+question/697175

Hey 😄
I am trying to send a mail using this code:

def start_user():
    print('sending mail to user')
    mail_sending = """
    powershell
    $EmailFrom = "[email protected]"
    $EmailTo = "[email protected]"
    $Subject ="Try done"
    $Body ="Content of body"
    $SMTPServer ="smtp.server"
    $SMTPClient = New-Object Net.Mail.SmtpClient($SMTPServer, 587)
    $SMTPClient.EnableSsl = $true
    $SMTPClient.Credentials = New-Object 
System.Net.NetworkCredential("[email protected]","password");
    $SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
    """
    returnCode = runScript(mail_sending)

it is working fine, using the right content.
But even after hours of research I can't find a way to insert the fields using 
variables of my script:

MyMail = [email protected]
email = [email protected]
and so on for

def start_user():
    print('sending mail to user')
    mail_sending = """
    powershell
    $EmailFrom = str(MyMail)
    $EmailTo = str(email)
    ...

anyone can help me?

thx



-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to