Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

CDO COM - Email Delivery


  • Please log in to reply
212 replies to this topic
Guest10
  • Members
  • 1216 posts
  • Last active: Oct 30 2015 05:12 PM
  • Joined: 27 Oct 2012

i am aware that the standard reply would be REGISTER the cdosys.dll. Or un-register/register the cdosys.dll. but do this at your own risk of hosing your machine (UNTESTED):

 

1. Confirm cdosys.dll path in your system32 directory
2. Un-register with c:\windows\system32>regsvr32 c:\windows\system32\cdosys.dll /u
3. Register with c:\windows\system32>regsvr32 c:\windows\system32\cdosys.dll
4. Re-boot

 

1. KEY_LOCAL_MACHINE/Software/Classes/CLASS_NAME
(Keep in mind CLASS_NAME will be replaced with the class name you are trying to instantiate)
Right click on it and then Permissions. Allow Full Access for SYSTEM and Administrator. (To be sure it works add "CREATOR OWNER" and "Users" users and allow Full Access to those too.)

2. KEY_LOCAL_MACHINE/Software/Classes/CLASS_NAME has a folder called CLASSID under it. Click on it and on the right side will appear the code of the class. This code you will type it in place of CLASS_ID in the following step:

3. Go to HKEY_LOCAL_MACHINE/Software/Classes/CLSID/{CLASS_ID} and add the same permissions as in step 1. Restart the computer and try run the script.

 

These error messages can appear for a few reasons. Some of the common reasons include

  • Invalid class string 
  • Unregistered DLL files
  • Invalid permissions

Also, see http://www.autohotke...d-class-string/

and http://www.autohotke...ressions/page-2



AHK_LDaniel
  • Members
  • 57 posts
  • Last active: Jul 07 2015 01:43 AM
  • Joined: 22 Aug 2012

Can someone create a script that sends email AND detects errors? I'm not sure how to detect errors.


There's a little girl behind you...
She's watching you're every move...

hamncheese
  • Members
  • 48 posts
  • Last active: Jan 16 2017 12:17 AM
  • Joined: 23 May 2012

Hello, Thank you Sean for this wonderful script, this script has made my life so much easier :D

and im running a little trouble and hoping some direction on how to manage this

so this is what im trying to achieve

 

Window A running > send hotkey > takes screenshot > send email + latest screenshot

 

i have no problem when using full path as the attachment address, email + attachment is sent successfully, but with this i cannot send the latest screenshot

so then this is what i have tried

 

ive added a Loop File/Folder on top of the Script

checking with MsgBox confirms that the file path and the latest screenshot is created correctly

			Loop, C:\Users\xxx\Documents\SomeRandomProgram\Screenshots\*.png
			{
				If (A_LoopFileTimeCreated>Rec)
				{
					FPath=%A_LoopFileFullPath%
					Rec=%A_LoopFileTimeCreated%
				}
			}
			msgbox, %FPath%

and the using the file path generated from %FPath%

i add that into Sean's script

			pmsg 			:= ComObjCreate("CDO.Message")
			pmsg.From 		:= """John Doe"" <[email protected]>"
			pmsg.To 		:= "[email protected]"
			pmsg.BCC 		:= ""
			pmsg.CC 		:= ""
			pmsg.Subject 	:= "Subject"

			;You can use either Text or HTML body like
			pmsg.TextBody 	:= "BodyMessage"
			;OR
			;pmsg.HtmlBody := "<html><head><title>Hello</title></head><body><h2>Hello</h2><p>Testing!</p></body></html>"


			sAttach   		:= "%FPath%" ; this is where i add the file path

			fields := Object()
			fields.smtpserver   := "smtp.gmail.com" ; specify your SMTP server
			fields.smtpserverport     := 465 ; 25
			fields.smtpusessl      := True ; False
			fields.sendusing     := 2   ; cdoSendUsingPort
			fields.smtpauthenticate     := 1   ; cdoBasic
			fields.sendusername := "[email protected]"
			fields.sendpassword := "MyPassword"
			fields.smtpconnectiontimeout := 60
			schema := "http://schemas.microsoft.com/cdo/configuration/"


			pfld :=   pmsg.Configuration.Fields

			For field,value in fields
				pfld.Item(schema . field) := value
			pfld.Update()

			Loop, Parse, sAttach, |, %A_Space%%A_Tab%
			pmsg.AddAttachment(A_LoopField)
			pmsg.Send()

and this is the Error ive got

Ddf77U8.png

 

Hopefully someone can help and shed some light for me, thank you for anyone reading this

ps: im sorry for the bad english

:)

 

edit :

this is the whole script

F3::		
			controlsend,, {F2}, SomeRandomProgramWindow
			Loop, C:\Users\xxx\Documents\SomeRandomProgram\Screenshots\*.png
			{
				If (A_LoopFileTimeCreated>Rec)
				{
					FPath=%A_LoopFileFullPath%
					Rec=%A_LoopFileTimeCreated%
				}
			}
			pmsg 			:= ComObjCreate("CDO.Message")
			pmsg.From 		:= """John Doe"" <[email protected]>"
			pmsg.To 		:= "[email protected]"
			pmsg.BCC 		:= ""
			pmsg.CC 		:= ""
			pmsg.Subject 	:= "Subject"

			;You can use either Text or HTML body like
			pmsg.TextBody 	:= "BodyMessage"
			;OR
			;pmsg.HtmlBody := "<html><head><title>Hello</title></head><body><h2>Hello</h2><p>Testing!</p></body></html>"


			sAttach   		:= "%FPath%" ; can add multiple attachments, the delimiter is |

			fields := Object()
			fields.smtpserver   := "smtp.gmail.com" ; specify your SMTP server
			fields.smtpserverport     := 465 ; 25
			fields.smtpusessl      := True ; False
			fields.sendusing     := 2   ; cdoSendUsingPort
			fields.smtpauthenticate     := 1   ; cdoBasic
			fields.sendusername := "[email protected]"
			fields.sendpassword := "MyPassword"
			fields.smtpconnectiontimeout := 60
			schema := "http://schemas.microsoft.com/cdo/configuration/"


			pfld :=   pmsg.Configuration.Fields

			For field,value in fields
				pfld.Item(schema . field) := value
			pfld.Update()

			Loop, Parse, sAttach, |, %A_Space%%A_Tab%
			pmsg.AddAttachment(A_LoopField)
			pmsg.Send()