AutoHotkey Community

It is currently May 27th, 2012, 4:32 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 199 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12, 13, 14  Next
Author Message
 Post subject:
PostPosted: March 2nd, 2010, 6:08 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
No, it's not that I want to prevent Tuncay or anyone else to redistribute COM.ahk. I was just reminded by tank that I once urged to have only one source of COM.ahk in the forum, due to the update issue. However, it's been long after the last update and I don't think there will be any other update either, so it may not be an issue anymore. (I suppose that COM will be built into AHK_L sooner or later.)

Anyway, just don't post the link to other location and/or don't copy the whole contents of COM.ahk in the posted code in the forum. Other than those, it's all up to your decision.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2010, 6:16 pm 
Offline

Joined: February 16th, 2010, 8:01 am
Posts: 800
Location: SciTE
Sean wrote:
No, it's not that I want to prevent Tuncay or anyone else to redistribute COM.ahk. I was just reminded by tank that I once urged to have only one source of COM.ahk in the forum, due to the update issue. However, it's been long after the last update and I don't think there will be any other update either, so it may not be an issue anymore.

Anyway, just don't post the link to other location or include the whole contents of COM.ahk in the posted code in the forum. Other than those, it's all up to your decision.


Thanks a lot Sean, I promise to abide by those rules. I do have a question though. Sorry I am inexperienced with COM but if I made an EXE of it then would the emailer in another script be able to run on a computer without AHK installed? If not how can I do that? Thanks again.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2010, 8:02 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
COM would have to be part of the compiled script either by it being in the lib folder or via include for the cdo to function

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2010, 8:05 pm 
tank wrote:
COM would have to be part of the compiled script either by it being in the lib folder or via include for the cdo to function


I see, thank you tank.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2010, 12:32 pm 
i would like to have this script in a function form. Am i allowed to wrap it as a function and republish it as a library? Or do you want make an official one at your first post?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2010, 3:04 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Yoy're Tuncay, right? If you put a proper credit, I don't have anything against it. And, no, I don't have a plan to update the code in the top post.

BTW, what will be the target(s) of the library? Only for the official build or also for AHK_L?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2010, 4:37 pm 
Yes it's me Tuncay. I can't login now.

I am using the mainstream ahk. Others version than this are not tested by me. I leave that to the original author of every library.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2010, 11:28 pm 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
Is this ok to use as a function? Would you suggest anything other than this? btw, the other parts of your code is leaved as is. I am just wrapping this script to a function.
Code:
cdomessage(sServer, nPort, bTLS, nSend, nAuth, sUsername, sPassword, sFrom, sTo, sSubject = "", sBody = "", sAttach = "")


Return code would be from
Code:
Send := COM_Invoke(pmsg, "Send")


I do not much understand the com and cdo etc.

_________________
{1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <--


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2010, 1:08 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
infogulch has already wrapped it into the function for AHK_L. The parmeter better be in that order, at least the fore part.
http://www.autohotkey.com/forum/topic39797-128.html

And, send has no return value.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2010, 11:14 am 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
Is this better? What return could it have?
Code:
/*
; In this example, Email is sent using GMail SMTP (SSL) server.
cdomessage( sFrom     := "Mail_Address_Of_Sender"
          , sTo       := "Mail_Address_Of_Receipient"
          , sSubject  := "Message_Subject"
          , sBody     := "Message_Text"
          , sUsername := "your_username"
          , sPassword := "your_password"
          , sServer   := "smtp.gmail.com"   ; specify your SMTP server
          , nPort     := 465                ; 25
          , bTLS      := True               ; False
          , sAttach   := ""                 ; Path of attachment, "|" delimieted
          , nSend     := 2                  ; cdoSendUsingPort
          , nAuth     := 1 )                ; cdoBasic
*/

; CDO COM - Email Delivery by Sean
; http://www.autohotkey.com/forum/viewtopic.php?t=39797
cdomessage(sFrom, sTo, sSubject, sBody, sUsername, sPassword, sServer, nPort = 25, bTLS = False, sAttach = "", nSend = 2, nAuth = 1)

His version is unusable to me. I am not using Ahk_L currently.

_________________
{1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <--


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2010, 3:11 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
I think what Sean means is that if you look at the parameters as related groups, all of the server specifications are mandatory while three of the mail-specific parameters (Subject, Body and Attach) are optional, so it's better just to move the entire group of mail-specific parameters to the end of the function:

Code:
cdo_message(sUsername, sPassword, sServer, nPort = 25, bTLS = False, nSend = 2, nAuth = 1,sFrom, sTo, sSubject="", sBody="", sAttach="")


Informally it might be slightly better to place the body parameter right before the subject parameter. Seems non-intuitive at first but many people send emails without subject lines, so it would save specifying a blank parameter in that case.

Tuncay wrote:
What return could it have?


I honestly don't think a return value would have any significance in this instance since the error messages the code already produces pretty much tell the story (although it would be nice to have a commented list of translations for the error messages in the function for reference, it might be a bit much).

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Last edited by sinkfaze on March 4th, 2010, 5:29 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2010, 4:24 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Actually what I'm using is this.
Code:
Email(sFrom, sTo, sSubject, sBody, sAttach, sServer, sUsername, sPassword, bTLS = True, nPort = 25, nSend = 2, nAuth = 1)

But, it has too many parameters and the ordering depends largely on user's typical usage of emails, so I left it to the users wrapping into a function.

BTW, cdosys.dll contains its own MessageTable, so you can also use FormatMessage API (with the flag FORMAT_MESSAGE_FROM_HMODULE), which COM_Error uses to format the system (:kernel32.dll) error messages.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 1:44 pm 
Offline

Joined: September 10th, 2009, 5:54 pm
Posts: 203
I could use clipboard as Body
Code:
sBody     := ""Clipboard ""


But how can I use my real user name and not the e-mail ID?

If I use this:

Code:
sUsername := "Dude"


I get error
But if I use my e-mail ID, for example.. If the e-mail I used was someone@gmail.com and I use
sUsername := "someone"
then it goes through but then the sender will be the e-mail address

Any ideas?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 2:52 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
Could you post the entire code you're using? It's hard to figure out with just that one small piece of information.

By the way, in Sean's code sUsername is the username logon for the SMTP server, sFrom is for the from field in the email.

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 4:33 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Yes, use sFrom as sinkfaze said. The usage is documented:
http://msdn.microsoft.com/en-us/library ... 10%29.aspx


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 199 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12, 13, 14  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group