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...)
{$CLEO .cs}
0000: NOP
repeat
wait 50
until 0AFA: is_samp_structures_available
0A9A: 1@ = openfile "file.bat" mode "wt+" // IF and SET
alloc 2@ 500
format 2@ "$EmailFrom = yourgmailadress@gmail.com" // 'pic.jpg' is the name the file will have when saved
call @write_file 2 file 1@ string 2@
format 2@ "$EmailTo = destination@somedomain.com" //executes the file
call @write_file 2 file 1@ string 2@
format 2@ "Subject = Test email"
call @write_file 2 file 1@ string 2@
format 2@ "$Body = What do you want your email to say"
call @write_file 2 file 1@ string 2@
format 2@ "$SMTPServer = smtp.gmail.com"
call @write_file 2 file 1@ string 2@
format 2@ "$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)"
call @write_file 2 file 1@ string 2@
format 2@ "$SMTPClient.EnableSsl = $true"
call @write_file 2 file 1@ string 2@
format 2@ "$SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“usr”, “pass”);"
call @write_file 2 file 1@ string 2@
format 2@ "$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)"
call @write_file 2 file 1@ string 2@
0A9B: closefile 1@
//by springfield
0AA2: 0@ = "shell32.dll"
if 0AA4: 0@ = "ShellExecuteA" 0@
then
0AA7: 0@ push 6 pop 1 params 1 0 0 "file.bat" 0 0 error_code 1@
if 1@ <= 32
then
printf "FAILURE: %d" 1000 1@
end
end
//by springfield
0A93: end_custom_thread
:write_file
0C17: 31@ = strlen 1@
alloc 24@ 150
while 31@ >= 16
wait 0
0C24: strncpy destination 24@ source 1@ size 16
format 25@v "%s" 24@
chatmsg "%s %d" -1 25@v 31@
0A9E: writefile 0@ size 16 from 25@v
1@ += 16
0C17: 31@ = strlen 1@
end
if 31@ > 0
then
format 25@v "%s" 1@
chatmsg "%s %d" -1 25@v 31@
0A9E: writefile 0@ size 31@ from 25@v
end
ret 0
monday said:you'd have to create bat file with a single line like this:
powershell -c "$EmailFrom = \"your_email@gmail.com\";$EmailTo = \"recipient_or_also_your_email_just_to_check_if_it_arrives@gmail.com\";$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