← Back to team overview

sikuli-driver team mailing list archive

[Question #697175]: passing string to shell using unscript

 

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 = "info@xxxxxxxx"
    $EmailTo = "mail@xxxxxxxx"
    $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("info@xxxxxxx","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 = myMail@xxxxxxxxxx
email = Tom@xxxxxxx
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.