Question

Status
Not open for further replies.

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
677
Likes
2
Points
18
Location
Lithuania
Website
ugbase.eu
#1
Possible send msg to email with sany builder (Cleo) ?
How to do that?

@monday
@springfield
@supahdupahnubah
@0x32789
@ini
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
918
Likes
3
Points
18
#2
if you don't find a better solution you could do it like:
1. Use powershell from command line (downside is that it will most likely pop up)
http://ugbase.eu/Thread-Presentation-Command-line-functionality
https://www.howtogeek.com/120011/stupid-geek-tricks-how-to-send-email-from-the-command-line-in-windows-without-extra-software/

2. Set up some free server to send the email after receiving get request with url-encoded message. (But using additional server as an intermediate could make the email useless, it could be stored by the server itself...)
 
OP
OP
Parazitas

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
677
Likes
2
Points
18
Location
Lithuania
Website
ugbase.eu
#3
monday said:
if you don't find a better solution you could do it like:
1. Use powershell from command line (downside is that it will most likely pop up)
http://ugbase.eu/Thread-Presentation-Command-line-functionality
https://www.howtogeek.com/120011/stupid-geek-tricks-how-to-send-email-from-the-command-line-in-windows-without-extra-software/

2. Set up some free server to send the email after receiving get request with url-encoded message. (But using additional server as an intermediate could make the email useless, it could be stored by the server itself...)
Maybe you can explane more? , i dont understand how use that :(  
@monday 

PHP:
{$CLEO .cs}
0000: NOP

repeat
wait 50
until 0AFA: is_samp_structures_available

0A9A: [email protected] = openfile "file.bat" mode "wt+"  // IF and SET

alloc [email protected] 500
format [email protected] "$EmailFrom = [email protected]"  // 'pic.jpg' is the name the file will have when saved
call @write_file 2 file [email protected] string [email protected]
format [email protected] "$EmailTo = [email protected]"  //executes the file
call @write_file 2 file [email protected] string [email protected]
format [email protected] "Subject = Test email"
call @write_file 2 file [email protected] string [email protected]
format [email protected] "$Body = What do you want your email to say"
call @write_file 2 file [email protected] string [email protected]
format [email protected] "$SMTPServer = smtp.gmail.com"
call @write_file 2 file [email protected] string [email protected]
format [email protected] "$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)"
call @write_file 2 file [email protected] string [email protected]
format [email protected] "$SMTPClient.EnableSsl = $true"
call @write_file 2 file [email protected] string [email protected]
format [email protected] "$SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“usr”, “pass”);"
call @write_file 2 file [email protected] string [email protected]
format [email protected] "$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)"
call @write_file 2 file [email protected] string [email protected]


0A9B: closefile [email protected]

        
//by springfield      
0AA2: [email protected] = "shell32.dll"
if 0AA4: [email protected] = "ShellExecuteA" [email protected]
then
  0AA7: [email protected] push 6 pop 1 params 1 0 0 "file.bat" 0 0 error_code [email protected]  
  if [email protected] <= 32
  then 
  printf "FAILURE: %d" 1000 [email protected]
  end
end
//by springfield 


0A93: end_custom_thread


:write_file
0C17: [email protected] = strlen [email protected]
alloc [email protected] 150

while [email protected] >= 16
   wait 0
   0C24: strncpy destination [email protected] source [email protected] size 16
   
   format [email protected] "%s" [email protected]
   chatmsg "%s %d" -1 [email protected] [email protected]
   0A9E: writefile [email protected] size 16 from [email protected]
   
   [email protected] += 16
   0C17: [email protected] = strlen [email protected]                
end

if [email protected] > 0
then
   format [email protected] "%s" [email protected]
   chatmsg "%s %d" -1 [email protected] [email protected]
   0A9E: writefile [email protected] size [email protected] from [email protected]
end

ret 0
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
918
Likes
3
Points
18
#4
you'd have to create bat file with a single line like this:

powershell -c "$EmailFrom = \"you[email protected]\";$EmailTo = \"[email protected]om\";$Subject = \"Subject\";$Body = \"Content\";$SMTPServer = \"smtp.gmail.com\";$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587);$SMTPClient.EnableSsl = $true;$SMTPClient.Credentials = New-Object System.Net.NetworkCredential($EmailFrom, \"your_gmail_password_here\");$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body);"

That's because the commands have to be executed from powershell, not the command line. -c parameter of the "powershell" command allows you to put all the commands in a string separated by ";", that's why all the double quotation marks have to be escaped by "\" sign, keep that in mind when you send some content with quotation marks.

I tested it and it worked but it is necessary to "allow access from less secure apps" in gmail settings
 
OP
OP
Parazitas

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
677
Likes
2
Points
18
Location
Lithuania
Website
ugbase.eu
#5
monday said:
you'd have to create bat file with a single line like this:

powershell -c "$EmailFrom = \"[email protected]\";$EmailTo = \"[email protected]om\";$Subject = \"Subject\";$Body = \"Content\";$SMTPServer = \"smtp.gmail.com\";$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587);$SMTPClient.EnableSsl = $true;$SMTPClient.Credentials = New-Object System.Net.NetworkCredential($EmailFrom, \"your_gmail_password_here\");$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body);"

That's because the commands have to be executed from powershell, not the command line. -c parameter of the "powershell" command allows you to put all the commands in a string separated by ";", that's why all the double quotation marks have to be escaped by "\" sign, keep that in mind when you send some content with quotation marks.

I tested it and it worked but it is necessary to "allow access from less secure apps" in gmail settings
So if i create bat file... how i put dialog editbox text in the bat file... and send to email?
I trying create email in game , just aswering to email when playing samp.
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
918
Likes
3
Points
18
#6
replace "Content" (marked by red) with whatever you want to send, but the command prompt window will appear anyway...
 
Status
Not open for further replies.
Top