Jump to content

Launching email without opening email client? [NON AUTOIT SOLUTION FOUND.]


Recommended Posts

Over the last couple of weeks I've kept coming back to the forums to search for what will do this. I have a pressing need to send emails to the office which basically are just short reminders of things to do so are mostly the subject line and sometimes an additional line or two at the most of text in the body.

At one point, I found a simple script that looked a lot like a small version of the compose window of your average email client but it had just a small line-sized box for the text in the body. The script was perfect for what I now need. At the time, it wasn't, so I never kept it and I haven't been able to find it again in all this time. I never sent an email when I tested that script out so I don't know if that one even worked at all. But all the other ideas I've found since then don't seem to do this type of thing. I don't need an email client replacement, per se, just a sort of quick way to send a short message to work by just clicking on the script and typing in a subject and, when needed, some body text.

Thanks much. :P

Edited by Diana (Cda)
Link to comment
Share on other sites

  • Developers

Have you looked at _InetSmtpMail() in the helpfile or search for _InetSmtpMailCom() in the Examples forum, which has more options ...

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Okay, I've looked and looked again. Found the email script that intrigued me, though it's working no better now than it did when I tried it out before. But I found it! (http://www.autoitscript.com/forum/index.php?showtopic=13101&hl=sending+email) I've made only very small modifications to the "readme" text box.

#include <GUIConstants.au3>
GUICreate("SMTP 25 1.1 by AsimZameer")
GUICtrlCreateLabel ("Smtp :",  20, 10, 50)
GUICtrlCreateLabel ("From :",  20, 40, 50)
GUICtrlCreateLabel ("To :",  20, 70, 50)
GUICtrlCreateLabel ("Name :",  20, 100, 50)
GUICtrlCreateLabel ("Subject :",  20, 130, 50)
GUICtrlCreateLabel ("Body :",  20, 160, 50)
GUICtrlCreateLabel ("Status :",  5, 215, 50)

$input1 = GUICtrlCreateInput("mx1.mail.yahoo.com",70,10,250,20)
$input2 = GUICtrlCreateInput("snip",70,40,250,20)
$input3 = GUICtrlCreateInput("snip",70,70,250,20)
$input4 = GUICtrlCreateInput("asimzameer",70,100,250,20)
$input5 = GUICtrlCreateInput("test message",70,130,250,20)
$input6 = GUICtrlCreateInput("Hello WOW ASIM SMTP really Works",70,160,250,20)
$myedit=GUICtrlCreateEdit ("Readme:  After clicking on the SEND button, wait until you get the message ''status = 3''. (which means that the email was successfully sent.)  //  Please fill in all the boxes correctly!  //  If the SMTP address doesn't work, this scripts automatically exits and closes."& @CRLF, 1,230,400,70,$WS_DISABLED)
$btn = GUICtrlCreateButton ("Send", 160, 310, 60, 20)
GUISetState ()
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
If $msg = $btn Then
$g_IP = GUICtrlRead($input1)
$sData1  = "HELO " & GUICtrlRead($input4) & @CRLF
$sData2  = "MAIL FROM: <" & GUICtrlRead($input2) &">" & @CRLF
$sData3  = "RCPT TO: <" & GUICtrlRead($input3) &"> "& @CRLF
$sData4  = "DATA" & @CRLF
$sData5  = "From:" & GUICtrlRead($input4) & "< " & GUICtrlRead($input2) &" >" & @CRLF
$sData6  = "To:" & GUICtrlRead($input3) & @CRLF
$sData7  = "Subject:" & GUICtrlRead($input5) & @CRLF
$sData8  = "Sender: Microsoft Outlook Express 6.00.2800.1158" & @CRLF
$sData9  = "Mime-Version: 1.0" & @CRLF
$sData10 = "Content-Type: text/plain; charset=US-ASCII" & @CRLF
$sData11 = @CRLF
$sData12 = GUICtrlRead($input6) & @CRLF
$sData13 = "." & @CRLF
TCPStartUp()
$socket = TCPConnect(TCPNameToIP($g_IP), 25)
If $socket = -1 Then Exit
$ret1  = GUICtrlSetData ($myedit,TCPSend($socket, $sData1) )
sleep(100)
$ret2  = GUICtrlSetData ($myedit,TCPSend($socket, $sData2) )
sleep(100)
$ret3  = GUICtrlSetData ($myedit,TCPSend($socket, $sData3) )
sleep(100)
$ret4  = GUICtrlSetData ($myedit,TCPSend($socket, $sData4) )
sleep(100)
$ret5  = GUICtrlSetData ($myedit,TCPSend($socket, $sData5) )
sleep(100)
$ret6  = GUICtrlSetData ($myedit,TCPSend($socket, $sData6) )
sleep(100)
$ret7  = GUICtrlSetData ($myedit,TCPSend($socket, $sData7) )
sleep(100)
$ret8  = GUICtrlSetData ($myedit,TCPSend($socket, $sData8) )
sleep(100)
$ret9  = GUICtrlSetData ($myedit,TCPSend($socket, $sData9) )
sleep(100)
$ret10 = GUICtrlSetData ($myedit,TCPSend($socket, $sData10) )
sleep(100)
$ret11 = GUICtrlSetData ($myedit,TCPSend($socket, $sData11) )
sleep(100)
$ret12 = GUICtrlSetData ($myedit,TCPSend($socket, $sData12) )
sleep(100)
$ret13 = GUICtrlSetData ($myedit,TCPSend($socket, $sData13) )
sleep(100)
EndIf
Wend
Nothing happened. No status or anything comes up in the box. My firewall does prompt me for permission but that's about it. When I grant it, script closes after about 15 seconds.

So I hunted down the SMTP of my ISP and then something did happen, only I just got a "0" in the box, which I believe I can presume means that the transmission didn't work. The SMTP address I input does need authenticating, however. At least, it does when I put it in my Outlook.

Can this be fixed in order to work? I'd love to have just a simple script. I know of at least one freeware to do this but if I use that, I'm no further ahead since I still must open an email client, no matter how much "simpler" it is. A quick script such as this fits the bill, if one could get it to work.

Thanks. :P

Edited by Melba23
Link to comment
Share on other sites

  • 4 weeks later...

Well, nothing came of this. As there were no replies and I couldn't figure it out on my own, I put it aside while trying to figure out a solution. I didn't find an AI one but I found a work around. I found out that an Outlook Express (OE) template email (.eml extension) can be created and used easily and mail is sent off _without_ having to pre-open the email client. Not so with Outlook. I've found that you must open Outlook for the mail to be sent. OE sends the email with no problems just by opening template and sending. Yet next time you open client, the email is there in your sent box, and, more importantly, it appears in the destination client.

So all's well that ends well.

Cheers. :)

Link to comment
Share on other sites

  • Developers
:) believe I pointed you to 2 UDFs that should work with AutoIt3 .. anyways you have a solution ^_^

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

:) believe I pointed you to 2 UDFs that should work with AutoIt3 .. anyways you have a solution ^_^

Thank you. I do appreciate that. But for those of us to whom this type of thing doesn't come easily, pointing at something is great but doesn't necessarily provide solution. As I showed in above script, I described problems that I couldn't get around. In the end, the closest I could get to a solution just did not work. And I'm afraid that I don't yet have the knowledge to know why not. My query asking about why this wouldn't work didn't garner any responses. That's okay. I've lived with this issue for a long time but it just became too tiresome to be constantly opening up my email client to send such simple messages. Fortunately, stumbled upon a solution completely by accident where an OE .EML template did the trick. Outlook would not. And it didn't matter that I use OE with a different email address. The end result was to find an easy way to send email. I just click the template, type the subject and send. I'm sure on some level Outlook Express does open, but I don't have to actively do it myself each time. I get results by, ultimately, 2 active mouse clicks and typing in the subject. Very simple

So I can live with this. Maybe later on I'll come back to this script when I know a bit more and see if I can figure out why it doesn't work.

Thanks much! :)

Link to comment
Share on other sites

  • Developers

The _InetSmtpMailCom() UDF I wrote and available in the Examples Forum is able to do Authenticated Smtp Emailing... probably would be the best option to persuit :)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...