View Full Version : SMTP Mail send Tool (command-line)
presidente
10-20-2008, 10:50 PM
This is a little command-line program to send mails.
http://sapco.info/software/minimail.zip
Itīs easy to use and can send attachments too.
It can be simply used with File.Run in AMS
The parameters to send the mail are:
1. MailServer
2. User name of the mail account
3. Password for the Mail account
4. Mail adress of the Sender (optional)
5. Name of the Email Sender (optional)
6. Mail adress of the Recipient
7. Subject of the Email (optional)
8. Text of the Email (optional)
9. Attachment (optional)
Usage:
minimail.exe "MailServer" "User Password" "Sender_Email" "Sender_Name" "Recipient" "Email_Subject" "Email_Text" "Attachment"
example with all parameters used:
minimail.exe "smtp.yahoo.com" "johnsmith@yahoo.com" "thatsmypassword" "johnsmith@yahoo.com" "John Smith" "hannah.montana@television.tv" "Thats the reason of my Email" "This could be a long text, but i want to make it short." "c:\Myfile.zip"
example without sending Subject and Attachment:
minimail.exe "smtp.yahoo.com" "johnsmith@yahoo.com" "thatsmypassword" "johnsmith@yahoo.com" "John Smith" "hannah.montana@television.tv" "" "This could be a long text, but i want to make it short." ""
minimail.exe writes the result of Email-sending to the file minimail.History.txt.
There you can see if there was an error sending the mail.
presidente
10-21-2008, 11:24 AM
Here you can download a little client I made with the command-line client.
The data for the mail-account is stored in an ini-file
http://sapco.info/software/MailClient-minimail.zip
http://sapco.info/software/minimail1.jpg
http://sapco.info/software/minimail2.jpg
The command-line client i have uploaded again.
Now he can send to a BCC adress and can send an attachment too.
http://sapco.info/software/minimail.zip
Protocol
10-21-2008, 11:29 AM
Very cool!
Dermot
10-21-2008, 02:13 PM
Works very well. Need to be able to also set the port though. For example when using an SMTP server from GoDaddy, you have to be able to set the port.
Nice job though, thanks for sharing.
presidente
10-21-2008, 04:15 PM
@Dermot
Download it again! Now the client have a parameter for the Port.
So you can set the Port for the SMTP-Server for use it with GoDaddy etc.
If you need a commnd line POP3 client, I can make it too.
abnrange
10-21-2008, 08:50 PM
Nice job - Thanks for the sample
Can you make a sample pop3?
DaSoulRed
10-23-2008, 02:16 PM
So if i donīt modify the code inside off AMS and i publish will not work
how to set by default the parameters, so that way allways send to the same address with out asking the user the destination off the mail and the user does not need to see the setup panel like a form contact
when i publish the webexe with out modify any thing when i try to set-up the mail server and stuff i cant send mail. why?
how to modify the code for this work rigth
thanks sorry for my bad english and semantics :)
presidente
10-23-2008, 03:07 PM
Just alter the variables.
Donīt read them from the input and put them static into the code.
If you make a webexe, the ini file is deleted everytime you close the program, because the webexe make the ini-file in a temporary folder.
So, next time you run the webexe the files are unpacked newly in a temporary folder and the ini-file is empty.
If it donīt works, could be that the data you put into the Mailaccount data is wrong.
You have to put the smtp-server in the mailserver field. Possibly you have putted the pop3 server.
Or the login-data is wrong. Check the username. Sometimes server want the mail-adress like login e.g. mymail@yahoo.com.
If you donīt set the port, the programm set the port 25.
Maybe you need another port.
Look into the code (is very vew and easy) and so you learn quickly how to use the program for your needs.
jassing
10-23-2008, 06:17 PM
Nice job - but wouldn't using blat.dll be a better/cleaner way to go?
DaSoulRed
10-23-2008, 07:23 PM
Just alter the variables.
Donīt read them from the input and put them static into the code.
If you make a webexe, the ini file is deleted everytime you close the program, because the webexe make the ini-file in a temporary folder.
So, next time you run the webexe the files are unpacked newly in a temporary folder and the ini-file is empty.
If it donīt works, could be that the data you put into the Mailaccount data is wrong.
You have to put the smtp-server in the mailserver field. Possibly you have putted the pop3 server.
Or the login-data is wrong. Check the username. Sometimes server want the mail-adress like login e.g. mymail@yahoo.com.
If you donīt set the port, the programm set the port 25.
Maybe you need another port.
Look into the code (is very vew and easy) and so you learn quickly how to use the program for your needs.
I Will Mess With It, and i will get the solution.
Let me tell you something if we need a presidente here i will let you Know :)
GateKeeper
12-18-2008, 09:12 AM
Hi there Guys, I am just a beginner with AMS, I have version 7 and I was wondering about sending email field into an app created with AMS.
Yesterday afternoon I spent lost of time, almost the whole journey to look for information on making it works for me, but It was almost impossible. I found good ways to do it, but most of them required an external helpī, plugin or code to be saved to the server. Since I am a student, it is dificult for me to afford that, so I would like the aplication to send an email by itself with no external help or plugin. I tried to do it by making an Input field and a pressing objet to send the email by taking the information to a text file and loading to my ftp quota ant the University, but firewall didnt allow it, and it is very difficult to find the authorization from directives to allow that, so I got interested on this example, but I can`t get all the steps, Could you make it clearer please?.
AMS application I am on the process of is a pack of free tools to fix pc problems and includes ccleaner, regseeker, security free apps from Antivirus sites and that stuff, to be used at Students Lab at my faculty. Then I want to add a "give your opinion chart" and that information to be sent to my email. I have hotmail, gmail, yahoo and my university (i know it is php) email accounts, but when I finish to study, I will lost my php university email account, so that is way I`m looking for a "Standalone" way into the soft to do it, and to be able to send it to anyone of the free accounts I mentioned.
Best Regards...
presidente
12-20-2008, 10:26 AM
Double-click on the "Send Email"-Button on page 2
There is all the code you need.
In line 48 the argument are putted together, and in line 51 the exe is called with the arguments.
Thats all the code you need. Itīs really very easy.
The rest of code is the getting of code from the input-fields.
On [Project][Actions] the parameters for the mail account are set, because the project uses an ini-file to store them.
But that you can do directly in the line 48 of the button-code.
So, just look at the line 48 and 51 of the code for the "Send Email"-Button on page 2.
Thats all you need to solve your problem.
GateKeeper
12-22-2008, 08:49 AM
Thanks for the explanation Presidente, but I have to say the files uploaded are not anymore. When I tried to download files you posted from http://sapco.info/software/minimail.zip, it got me 404 error page does not exists. I tried with mozilla, Internet Explorer 7 and Opera and none ofo them could access the site.
Could you upload the example again please?.
Thanks anyway for the help so far...
presidente
12-22-2008, 06:47 PM
Now the links are working again.
The directory was moved to a wrong place.
When I use this it sends correctly, but nothing after the File.Run("AutoPlay\\Docs\\minimail.exe", minimail_Args, "", SW_SHOWNORMAL, false);
works correctly. It give me the 'autoplay has stopped working' error and shuts down abruptly. I have no idea why this is happening. It is not waiting for a return, so maybe it is trying to run the minimail.exe while trying to execute the rest of the code. I have tried changing the wait for return to true and just have it go in an arbitrary variable, with no luck. Please let me know if anyone else is having this same problem, or just me.
Thanks,
MSP
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.