alexb 2 Posted February 13, 2014 Report Share Posted February 13, 2014 Hi everyone, I can't seem to get the "connect to mail server" to pull the data to connect from the database file. It DOES work when I enter the actual usernames and passwords for the email accounts, but I need to it pull it from the data file and can't figure out a way to supply it. create table from file("{$special folder("Desktop")}\\Desktop\\accounts.csv", &logins)set(#incrementing, 0, "Global")add list to table as column(&logins, 0, 2, %email)add list to table as column(&logins, 0, 4, %password)connect to mail server("POP3", $table cell(&logins, #incrementing, 2), $table cell(&logins, #incrementing, 4), "pop.domain.com", 110) {} FYIacccounts.csv: (here is the database layout)Jim,Smith,jimsmith@gmail.com,jimsmith,mypassword Any thoughts on how this can be done? Thanks Quote Link to post Share on other sites
Pete 121 Posted February 13, 2014 Report Share Posted February 13, 2014 Looks like you need to remove the two "add list to table as column" commands Quote Link to post Share on other sites
alexb 2 Posted February 13, 2014 Author Report Share Posted February 13, 2014 Tried that but didn't fix the problem. But thank you for your effort to help me. I am now ready to submit a challenge to anyone to connect to an email server using variables. I don't think it is possible, but I want to be proven wrong: Here is an example that is not throwing any errors, but does not show email server connection in debugger: add list to list(%email, $list from file("{$special folder("Desktop")}\\test\\username.txt"), "Delete", "Global")add list to list(%password, $list from file("{$special folder("Desktop")}\\test\\password.txt"), "Delete", "Global")set(#email, $list item(%email, 0), "Global")set(#password, $list item(%password, 0), "Global")connect to mail server("POP3", $list item(%email, 0), $list item(%password, 0), "pop.emailserver.com", 110) {} I hope there is a way to connect to email server via variables, but the above example seems to be demonstrating it is not possible. My guess is that have yet to code this into Ubot and presently requires inputs of actual password and username to work. Quote Link to post Share on other sites
Pete 121 Posted February 14, 2014 Report Share Posted February 14, 2014 Opps sorry missed one create table from file("{$special folder("Desktop")}\\Desktop\\accounts.csv", &logins) Also remove the second \\Desktop I’m surprised you did not get a error message for the file path Quote Link to post Share on other sites
alexb 2 Posted February 14, 2014 Author Report Share Posted February 14, 2014 Yes, path errors will always cause a script to work. However, even when corrected, I am not able to connect to email server using variables. I have yet to see anyone demonstrate that it is possible. And if it is, I would love to know what I am doing wrong in the code to connect using variables rather than having the actual "username" and "password" in quotes to connect. Is UBOT simply not coded to connect to mail server using variables for username and password? Quote Link to post Share on other sites
Pete 121 Posted February 14, 2014 Report Share Posted February 14, 2014 What version of ubot are you using? Quote Link to post Share on other sites
alexb 2 Posted February 15, 2014 Author Report Share Posted February 15, 2014 I am using 5.0 and also talking with support about this. I will post when resolved. Also, if any of you know how to code this with variables successfully, please let me know. Thank you. Quote Link to post Share on other sites
Business Minder 0 Posted February 27, 2014 Report Share Posted February 27, 2014 alexb, the email commands work just fine. I did run into similar issue that you are facing but make sure that you trim your variables before passing to the function. Make sure you $trim all of your values including the username, password...etc. e.g.: set(#RecipientFirstName, $trim($table cell(&Recipients, 0, 0)), "Global") set(#RecipientLastName, $trim($table cell(&Recipients, 0, 1)), "Global") set(#RecipientFullName, $trim($table cell(&Recipients, 0, 2)), "Global") set(#RecipientEmail, $trim($table cell(&Recipients, 0, 3)), "Global") set(#StatsMonitor, "Processing recipient {#RecipientFullName} ( {#RecipientEmail} )", "Global") if($comparison(#EmailService, "=", "GMAIL")) { then { connect to mail server("SMTP With SSL", #EmailUsername, #EmailPassword, "smtp.gmail.com", 465) { send email(#RecipientEmail, #EmailSubject, "Plain Text", #EmailContent, "", "", "") } } } Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.