Jump to content
UBot Underground

Question about a basic emailer


Recommended Posts

Hi guys,

I am having a brain fart while coding a basic emailer using "connect to mail server" What I have will send an email from a text file, but it sends to all emails in the list. What I want to do is send to each email in the list consecutively about every minute or two. I know this is simple but like I said I having a brain fart LOL! Just not clear on how to set the normal commands to do this within the "connect to mail server" node.

Thanks,

Chris

Link to post
Share on other sites

This might be close to what you are looking for:

 

set list position(%List of email addresses here, 0)
loop($list total(%List of email addresses here)) {
    connect to mail server("SMTP With SSL""youremailusername@gmail.com""password""smtp.gmail.com", 587) {
        send email($next list item(%List of email addresses here), "subject""Plain Text""Your Message here""""""")
        wait($rand(60, 120))
    }
}

  • Like 1
Link to post
Share on other sites

This might be close to what you are looking for:

 

set list position(%List of email addresses here, 0)

loop($list total(%List of email addresses here)) {

    connect to mail server("SMTP With SSL""youremailusername@gmail.com""password""smtp.gmail.com", 587) {

        send email($next list item(%List of email addresses here), "subject""Plain Text""Your Message here""""""")

        wait($rand(60, 120))

    }

}

this code is not good - it is better to insert loop inside "connect to mail server" command otherwise it will try to connect to server each loop which is very bad.

  • Like 1
Link to post
Share on other sites

Good point, I pulled this out of a bot that was actually trying to accomplish something else.

 

The better code would be:

 

set list position(%List of email addresses here, 0)
connect to mail server("SMTP With SSL""youremailusername@gmail.com""password""smtp.gmail.com", 587) {
    loop($list total(%List of email addresses here)) {
        send email($next list item(%List of email addresses here), "subject""Plain Text""Your Message here""""""")
    }
    wait($rand(60, 120))
}

  • Like 1
Link to post
Share on other sites

Ok, so here is what I have and nothing happens when I run it

 

ui open file("Email List", #email)
ui text box("Subject", #subject)
ui block text("Message:", #message)
ui open file("Attachment:", #attach)
set list position(%email, 0)
connect to mail server("SMTP With SSL", "emailaddy@gmail.com", "password", "smtp.gmail.com", 587) {
    loop($list total(%email)) {
        send email($next list item(%email), $spin(#subject), "HTML", $spin(#message), "", "", "")
        wait($rand(60, 120))
    }
}
This looks to me like it should work but I get nothing when I run it & nothing in debugger. My list is in a text file and I have tried separated by commas & a list in a column
Thanks everyone! This forum ROCKS!
 
Link to post
Share on other sites

 

Ok, so here is what I have and nothing happens when I run it

 

ui open file("Email List", #email)
ui text box("Subject", #subject)
ui block text("Message:", #message)
ui open file("Attachment:", #attach)
set list position(%email, 0)
connect to mail server("SMTP With SSL", "emailaddy@gmail.com", "password", "smtp.gmail.com", 587) {
    loop($list total(%email)) {
        send email($next list item(%email), $spin(#subject), "HTML", $spin(#message), "", "", "")
        wait($rand(60, 120))
    }
}
This looks to me like it should work but I get nothing when I run it & nothing in debugger. My list is in a text file and I have tried separated by commas & a list in a column
Thanks everyone! This forum ROCKS!
 

 

Looks like %email is empty. Just before set list position command, add the variable #email to the list %email.

  • Like 1
Link to post
Share on other sites

Hi jomark3 thanks for the help. I set the variable in a set command like this: set(#email, %email, "Global") ,and still nothing when I run it it deletes the chosen file from the ui interface. Here is the code as it is now:

 

ui open file("Email List", #email)
ui text box("Subject", #subject)
ui block text("Message:", #message)
ui open file("Attachment:", #attach)
set(#email, %email, "Global")
set list position(%email, 0)
connect to mail server("SMTP With SSL", "emailaddress@gmail.com", "password", "smtp.gmail.com", 587) {
    loop($list total(%email)) {
        send email($next list item(%email), #subject, "Plain Text", #message, "", "", "")
        wait($rand(60, 120))
    }
}
How should my list be formatted? I have tried both email1,email2,email3, etc and I have tried:
email1
email2
email3
etc...
both in text files. I am thinking that somehow this is my problem but not sure.
Thanks again to you and to everyone for the help
Link to post
Share on other sites

The problem is you don't have anything in your %email list.

 

This line here:

 

set(#email, %email, "Global")

 

Is not doing what you think its doing... this is RESETTING the #email variable with an empty list.

 

What you should have instead is:

 

add list to list(%email$list from file(#email), "Delete""Global")

 

 

Does Standard version not have a Debugger?

  • Like 1
Link to post
Share on other sites

Hey Lucius,

Thanks so much for the help. Yes we do have debugger but I was getting nothing because obviously I had it all wrong LOL! Plus the fact that I only have about 3 months of Ubot under my belt an hour or two a day may explain where I am at. I added the "add list to list" command and now I am getting a script error. I will attach 2 captures of the error & here is my code as I have it now:

 

ui open file("Email List", #email)
ui text box("Subject", #subject)
ui block text("Message:", #message)
ui open file("Attachment:", #attach)
add list to list(%email, $list from file(#email), "Delete", "Global")
set list position(%email, 0)
connect to mail server("SMTP With SSL", "emailaddress@gmail.com", "password", "smtp.gmail.com", 587) {
    loop($list total(%email)) {
        send email($next list item(%email), #subject, "Plain Text", #message, "", "", "")
        wait($rand(60, 120))
    }
}
 

If anyone has any idea where I am going wrong with this I truly appreciate any and all help.

Thanks everyone!

Chris

post-6752-0-41473600-1365285018_thumb.png

Edited by beachwood
Link to post
Share on other sites

Your code above is working for me.

 

From the error you're getting, it seems like the #email variable is not being set.

 

When you load your email.txt file, and before you move on to the next node, open up your Debugger, the #email variable should be set to the full path of the email.txt file.  Else you will  have a script error like you are getting.

 

You should make sure each variable is set before moving on the next node, where that variable is needed.

 

Get in the habit of using the "Step" button, with the Debugger window open to the side, so you can make sure your variables are being set correctly.

 

PS - check your PM.

Link to post
Share on other sites

Hey Lucius, thank you my friend, you are the man!. That should work. Makes complete sense to me and will see what happens when I change it. Also, thanks for the heads up pm, totally spaced that one out :o

Again, thanks for helping a noob out.

Chris

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...