FireFox

Skype UDF v1.2 (Sep 15, 2013)

149 posts in this topic




Huge functions list, great job! :graduated:


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites

nice job! I will test it

Share this post


Link to post
Share on other sites

Dude you are amazing. This is so going in my downloads folder.


ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thanks for your feedback :graduated:

I have added the "Auto Anwser" example Posted Image

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Hi Firefox, great job... I will start to test very soon.

DO you know a place/documentation where I can know what each function does? Maybe at skype homepage?

THANKS

Jose

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Hi Firefox, great job... I will start to test very soon.

DO you know a place/documentation where I can know what each function does? Maybe at skype homepage?

THANKS

Jose

You've got a description for each function in the UDF.

I don't think that the manual available will help you, link here

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Thanks !, I have worked on it for many days. I'm happy to have a feedback like yours because they are not as numerous as you can see.

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#10 ·  Posted

Hi there,

I just ran across this by accident and it reminded me of a problem I tried to solve a few months ago, but wasn't able to:

I can send messages to every single member of my Skype list, but we have a "group" that I tried to inform about a set of values at regular intervals (about once every 4 hours).

The problem is that this step works, if I create a group and adress it, but for some unknown reason, our existing "group" (I'm writing it in parentheses, because Skype seems to treat it as something other than a group - and sadly, I did not create it) is not treated as such and DOES NOT show in the list of participants when I run your "Skype in AutoIT.au3".

In my actual Skype contact's list, it shows with a logo similar to the "Online" symbol, but with a circle of 6 white points around the center.

If I remember right, the lines

$ichat = $oSkype.get_Chat("#xyz.dev/$febc24a082b613eb")
For $aChat In $ichat.Chats
If $aChat.Timestamp >= "20120907000149" Then
$msgstring = $msgstring & @CR & $aChat.Timestamp & " | Groupname:" & $aChat.GroupName & " | Name:" & $aChat.Name & "| FriendlyName:" & $aChat.FriendlyName
ConsoleWrite("-> " & @ScriptLineNumber & " " & $msgstring & @CRLF)
EndIf
Next
worked correctly on all other groups, but not this one.

$oSkype.RecentChats reports all chats of that group with the name ("#xyz.dev/$febc24a082b613eb"), but all attempts at sending them a message with either $oSkype.SendMessage(...) or $oSkype.Client.OpenUserInfoDialog("#xyz.dev/$febc24a082b613eb") and similar fail.

Your function displayChatProperties($aChat) reports

(Label: some group of people - sensible easygoing chat.. (sun)

Created at: 20120603013930

Last activity at: 20121028162704

Id: #xyz.dev/$febc24a082b613eb

Blob: 9Ec90D8ftJYM4SvdywDZqXIzfMdkVvWkDU ... vlCwtU3h5QmoQEZJuCeZDYVA

Description:

Guidelines:

My role: Master

My status: Subscribed

Type: Multichat

Members:

member1

member 2

memberxyz

memberetc.

Is anybody aware of a special command to send a message to a multichat (I couldn't fond any in the Skype docs either)?

Share this post


Link to post
Share on other sites

#11 ·  Posted

@guwguw

Maybe the UDF is deprecated due to new Skype functions.

The only way for me to help you would to test it, so add me in skype you will find my ID on my profile.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#12 ·  Posted

@guwguw

Maybe the UDF is deprecated due to new Skype functions.

I doubt that: I'm using version 4.2.0.187

will get in touch via Skype later tonight

Share this post


Link to post
Share on other sites

#13 ·  Posted

This is the solution for our friend :

#include "Skype.au3"

Global $aChat = _Skype_ChatGetActive(), $oChat

For $iChat = 0 To UBound($aChat) -1
 $oChat = $aChat[$iChat]
 If _Skype_ChatGetName($oChat) = "#abc.def/$febc24a082b613eb" Then ExitLoop ;we've found the chat name
Next

_Skype_ChatSendMessage($oChat, "test") ;send test to the chat

Be reminded that you must store the object in a variable before using it ! (it won't work if you use it directly with the array)

@everybody

New version available ! (see first post for update)

1 person likes this

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#14 ·  Posted

Hi, I am running Skype 6.0 on my W7.

your UDF doesn't work on autoit 64bit.

So you could put this line in your example script:

#AutoIt3Wrapper_UseX64=n

With that it works always well.

How do you use your UDF to make a VideoCall?

Thank you

Share this post


Link to post
Share on other sites

#15 ·  Posted

So you could put this line in your example script:

OK I will add this under "Notes".

How do you use your UDF to make a VideoCall?

hm... never tested it, I will give it a try.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

I have just tested it and it won't work as you expected.

First, you have to make a simple call and when this one is in progress start the video.

Note that your contact will have to click on the webcam button to activate it on his side.

#include "Skype.au3"

_Skype_OnEventCallStatus("CallStatusEvent_InProgress", $cClsInProgress)

;~ _Skype_UserGetIsVideoCapable ;you can use it to check if the video call is possible

Global $oCall = _Skype_CallCreate("useridhere")

While 1
    Sleep(1000)
WEnd

Func CallStatusEvent_InProgress($oCall)
    _Skype_CallStartVideoSend($oCall)
    _Skype_CallStartVideoReceive($oCall)
EndFunc

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Thank you.

Another useful thing could be to determine which webcam to use/switch from the pc.

I am searching another thing: I would like to receive on my phone a call with more information just near the user name.

I have a prog that makes a call to phone from the pc and I want to recognize which action took place.

The only thing I got is make the call, answer it, then send a message during the call and open it to know the reason.

It could be a lot better if i could put the text near the user caller so I don't need to answer.

It needs the call because sending only the message doesn't make the cell ring loud and for some time.

Edited by frank10

Share this post


Link to post
Share on other sites

#18 ·  Posted

Another useful thing could be to determine which webcam to use/switch from the pc.

Well, I don't think it's possible. You can get and set the video devices with the _Skype_[set/Get]VideoIn functions.

I suggest you to list your video devices by switching them manually from Skype and then getting them with the _Skype_GetVideoIn func.

I think that Skype will return an error if you try to set a video device not connected.

In case it's not working you will have to use an external application to check the video device.

I am searching another thing: I would like to receive on my phone a call with more information just near the user name.

I have a prog that makes a call to phone from the pc and I want to recognize which action took place.

The only thing I got is make the call, answer it, then send a message during the call and open it to know the reason.

It could be a lot better if i could put the text near the user caller so I don't need to answer.

It needs the call because sending only the message doesn't make the cell ring loud and for some time.

I don't understand what you mean by "more information" and "recognize which action".

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#19 ·  Posted

SetVideoIn works well to select the correct webcam before starting the call, but it doesn't change the webcam during the call, like this:

_Skype_SetVideoIn('HP Webcam HD-4110')

_Skype_OnEventCallStatus("CallStatusEvent_InProgress", $cClsInProgress)
Global $oCall = _Skype_CallCreate("Francesem10")

While 1
    Sleep(30000)
    _Skype_SetVideoIn('Philips SPC 900NC PC Camera')
    _Skype_CallStartVideoSend($oCall)


WEnd

It blacks the pic for some seconds but then it continues with the first webcam.

While if I make these steps manually, it works also during a call:

Make call, options-> Video Settings ->select new webcam-> save webcam

then video->start video

the Videocall changes the webcam video.

I was thinking if there is something similar in skype4com, maybe it lacks the "start video" command to reinitialize the new webcam.

For the other problem, I mean: if I get action1 in the pc I will send a text like "action1 occurred", for action2 I will send "action2" and so on.

At this time i send this text in the instant message comunication after I answer the call.

I'm asking if it's possible to incorporate some text message directly near the user caller when the phone rings.

BTW:

there is a typo in the description of this func:

Func _Skype_CallStopVideoReceive($oCall)

it's called startVideo

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

SetVideoIn works well to select the correct webcam before starting the call, but it doesn't change the webcam during the call

It blacks the pic for some seconds but then it continues with the first webcam.

It's maybe an API issue.

Try this (not tested) :

...
_Skype_OnEventCallVideoStatusChanged("CallVideoStatusEvent")

;your script with video call
$oCall = ...

Func CallVideoStatusEvent($oCall, $TCallVideoStatus)
    If $TCallVideoStatus = $cCvsBothEnabled Then
;~      _Skype_CallStopVideoSend($oCall) ;uncomment this in case the script does not work
;~      _Skype_CallStopVideoReceive($oCall) ;same

        _Skype_SetVideoIn(...)

        _Skype_CallStartVideoSend($oCall)
        _Skype_CallStartVideoReceive($oCall)
    EndIf
EndFunc

For the other problem, I mean: if I get action1 in the pc I will send a text like "action1 occurred", for action2 I will send "action2" and so on.

At this time i send this text in the instant message comunication after I answer the call.

I'm asking if it's possible to incorporate some text message directly near the user caller when the phone rings.

Hm... try _Skype_ProfileGet/SetMoodText, but I don't see the problem of sending a message (notifications?)

BTW:

there is a typo in the description of this func:

Func _Skype_CallStopVideoReceive($oCall)

it's called startVideo

Right, when you make a thousand of functions you just stop checking what you have done :)

@everyone

New version available !

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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

  • Similar Content

    • TheDcoder
      [Sloved] Prevent _IENavigate from outputting to console
      By TheDcoder
      Hello! _IENavigate is outputting "Vector smash protection is enabled." when I run this script:
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> Global $g_hMainGUI = GUICreate("Test GUI", 500, 300, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) Global $g_oIE = _IECreateEmbedded() Global $g_idIE = GUICtrlCreateObj($g_oIE, 0, 0, 500, 300) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) _IENavigate($g_oIE, "http://www.coolwidgetsgadgets.com/widgets/elastic-man.swf") GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd _IEQuit($g_oIE) GUIDelete($g_hMainGUI) Exit Is there a way to prevent this? or do I have to do it the hard way (I can't find the code to which does ConsoleWrite())
       
      Thanks in Advance! TD
      Edit: You cannot replicate this in other websites like google.com
    • mLipok
      SMTP Mailer UDF
      By mLipok
      I very long time was using
       

       
       
      In the end, I found that at present my needs I need to modify it. And here it is:
      #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 ;~ #AutoIt3Wrapper_Run_Debug_Mode=Y ;(Y/N) Run Script with console debugging. Default=N #Region INCLUDE ;################################## ; Include ;################################## #include <file.au3> #EndRegion INCLUDE #Region Variables ;################################## ; Variables ;################################## Global Enum _ $g__INetSmtpMailCom_ERROR_FileNotFound = 1, _ $g__INetSmtpMailCom_ERROR_Send, _ $g__INetSmtpMailCom_ERROR_ObjectCreation, _ $g__INetSmtpMailCom_ERROR_COUNTER Global Const $g__cdoSendUsingPickup = 1 ; Send message using the local SMTP service pickup directory. Global Const $g__cdoSendUsingPort = 2 ; Send the message using the network (SMTP over the network). Must use this to use Delivery Notification Global Const $g__cdoAnonymous = 0 ; Do not authenticate Global Const $g__cdoBasic = 1 ; basic (clear-text) authentication Global Const $g__cdoNTLM = 2 ; NTLM ; Delivery Status Notifications Global Const $g__cdoDSNDefault = 0 ; None Global Const $g__cdoDSNNever = 1 ; None Global Const $g__cdoDSNFailure = 2 ; Failure Global Const $g__cdoDSNSuccess = 4 ; Success Global Const $g__cdoDSNDelay = 8 ; Delay Global Const $g__cdoDSNSuccessFailOrDelay = 14 ; Success, failure or delay #EndRegion Variables #Region Example Script ;################################## ; Example Script ;################################## ;~ _Example() Func _Example() Local $sSmtpServer = "MailServer" ; address for the smtp-server to use - REQUIRED Local $sFromName = "Name" ; name from who the email was sent Local $sFromAddress = "your@Email.Address.com" ; address from where the mail should come Local $sToAddress = "your@Email.Address.com" ; destination address of the email - REQUIRED Local $sSubject = "Userinfo" ; subject from the email - can be anything you want it to be Local $sBody = "" ; the messagebody from the mail - can be left blank but then you get a blank mail Local $sAttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed Local $sCcAddress = "CCadress1@test.com" ; address for cc - leave blank if not needed Local $sBccAddress = "BCCadress1@test.com" ; address for bcc - leave blank if not needed Local $sImportance = "Normal" ; Send message priority: "High", "Normal", "Low" Local $sUsername = "******" ; username for the account used from where the mail gets sent - REQUIRED Local $sPassword = "********" ; password for the account used from where the mail gets sent - REQUIRED Local $iIPPort = 25 ; port used for sending the mail Local $bSSL = False ; enables/disables secure socket layer sending - set to True if using httpS ; Local $iIPPort = 465 ; GMAIL port used for sending the mail ; Local $bSSL = True ; GMAIL enables/disables secure socket layer sending - set to True if using httpS Local $bIsHTMLBody = False Local $iDSNOptions = $g__cdoDSNDefault Local $rc = _INetSmtpMailCom($sSmtpServer, $sFromName, $sFromAddress, $sToAddress, $sSubject, $sBody, $sAttachFiles, $sCcAddress, $sBccAddress, $sImportance, $sUsername, $sPassword, $iIPPort, $bSSL, $bIsHTMLBody, $iDSNOptions) If @error Then MsgBox(0, "_INetSmtpMailCom(): Error sending message", _ "Error code: " & @error & @CRLF & @CRLF & _ "Error Hex Number: " & _INetSmtpMailCom_ErrHexNumber() & @CRLF & @CRLF & _ "Description: " & _INetSmtpMailCom_ErrDescription() & @CRLF & @CRLF & _ "Description (rc): " & $rc & @CRLF & @CRLF & _ "ScriptLine: " & _INetSmtpMailCom_ErrScriptLine() _ ) ConsoleWrite("### COM Error ! Number: " & _INetSmtpMailCom_ErrHexNumber() & " ScriptLine: " & _INetSmtpMailCom_ErrScriptLine() & " Description:" & _INetSmtpMailCom_ErrDescription() & @LF) EndIf EndFunc ;==>_Example #EndRegion Example Script #Region UDF Functions ; The UDF ; #FUNCTION# ==================================================================================================================== ; Name ..........: _INetSmtpMailCom ; Description ...: ; Syntax ........: _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress[, $s_Subject = ""[, $as_Body = ""[, ; $s_AttachFiles = ""[, $s_CcAddress = ""[, $s_BccAddress = ""[, $s_Importance = "Normal"[, $s_Username = ""[, ; $s_Password = ""[, $IPPort = 25[, $bSSL = False[, $bIsHTMLBody = False[, $iDSNOptions = $g__cdoDSNDefault]]]]]]]]]]]]) ; Parameters ....: $s_SmtpServer - A string value. ; $s_FromName - A string value. ; $s_FromAddress - A string value. ; $s_ToAddress - A string value. ; $s_Subject - [optional] A string value. Default is "". ; $s_Body - [optional] A string value. Default is "". ; $s_AttachFiles - [optional] A string value. Default is "". ; $s_CcAddress - [optional] A string value. Default is "". ; $s_BccAddress - [optional] A string value. Default is "". ; $s_Importance - [optional] A string value. Default is "Normal". ; $s_Username - [optional] A string value. Default is "". ; $s_Password - [optional] A string value. Default is "". ; $IPPort - [optional] An integer value. Default is 25. ; $bSSL - [optional] A binary value. Default is False. ; $bIsHTMLBody - [optional] A binary value. Default is False. ; $iDSNOptions - [optional] An integer value. Default is $g__cdoDSNDefault. ; Return values .: None ; Author ........: Jos ; Modified ......: mLipok ; Remarks .......: ; Related .......: http://www.autoitscript.com/forum/topic/23860-smtp-mailer-that-supports-html-and-attachments/ ; Link ..........: http://www.autoitscript.com/forum/topic/167292-smtp-mailer-udf/ ; Example .......: Yes ; =============================================================================================================================== Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $s_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance = "Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $bSSL = False, $bIsHTMLBody = False, $iDSNOptions = $g__cdoDSNDefault) ; init Error Handler _INetSmtpMailCom_ErrObjInit() Local $objEmail = ObjCreate("CDO.Message") If Not IsObj($objEmail) Then Return SetError($g__INetSmtpMailCom_ERROR_ObjectCreation, Dec(_INetSmtpMailCom_ErrHexNumber()), _INetSmtpMailCom_ErrDescription()) ; Clear previous Err information _INetSmtpMailCom_ErrHexNumber(0) _INetSmtpMailCom_ErrDescription('') _INetSmtpMailCom_ErrScriptLine('') $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject ; Select whether or not the content is sent as plain text or HTM If $bIsHTMLBody Then $objEmail.Textbody = $s_Body & @CRLF Else $objEmail.HTMLBody = $s_Body EndIf ; Add Attachments If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) If FileExists($S_Files2Attach[$x]) Then ConsoleWrite('+> File attachment added: ' & $S_Files2Attach[$x] & @LF) $objEmail.AddAttachment($S_Files2Attach[$x]) Else ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF) Return SetError($g__INetSmtpMailCom_ERROR_FileNotFound, 0, 0) EndIf Next EndIf ; Set Email Configuration $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = $g__cdoSendUsingPort $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer If Number($IPPort) = 0 Then $IPPort = 25 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $s_Username <> "" Then $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = $g__cdoBasic $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = $bSSL ;Update Configuration Settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_Importance Case "High" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "High" Case "Normal" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "Normal" Case "Low" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "Low" EndSwitch ; Set DSN options If $iDSNOptions <> $g__cdoDSNDefault And $iDSNOptions <> $g__cdoDSNNever Then $objEmail.DSNOptions = $iDSNOptions $objEmail.Fields.Item("urn:schemas:mailheader:disposition-notification-to") = $s_FromAddress ;~ $objEmail.Fields.Item("urn:schemas:mailheader:return-receipt-to") = $s_FromAddress EndIf ; Update Importance and Options fields $objEmail.Fields.Update ; Sent the Message $objEmail.Send If @error Then _INetSmtpMailCom_ErrObjCleanUp() Return SetError($g__INetSmtpMailCom_ERROR_Send, Dec(_INetSmtpMailCom_ErrHexNumber()), _INetSmtpMailCom_ErrDescription()) EndIf ; CleanUp $objEmail = "" _INetSmtpMailCom_ErrObjCleanUp() EndFunc ;==>_INetSmtpMailCom ; ; Com Error Handler Func _INetSmtpMailCom_ErrObjInit($bParam = Default) Local Static $oINetSmtpMailCom_Error = Default If $bParam == 'CleanUp' And $oINetSmtpMailCom_Error <> Default Then $oINetSmtpMailCom_Error = '' Return $oINetSmtpMailCom_Error EndIf If $oINetSmtpMailCom_Error = Default Then $oINetSmtpMailCom_Error = ObjEvent("AutoIt.Error", "_INetSmtpMailCom_ErrFunc") EndIf Return $oINetSmtpMailCom_Error EndFunc ;==>_INetSmtpMailCom_ErrObjInit Func _INetSmtpMailCom_ErrObjCleanUp() _INetSmtpMailCom_ErrObjInit('CleanUp') EndFunc ;==>_INetSmtpMailCom_ErrObjCleanUp Func _INetSmtpMailCom_ErrHexNumber($vData = Default) Local Static $vReturn = 0 If $vData <> Default Then $vReturn = $vData Return $vReturn EndFunc ;==>_INetSmtpMailCom_ErrHexNumber Func _INetSmtpMailCom_ErrDescription($sData = Default) Local Static $sReturn = '' If $sData <> Default Then $sReturn = $sData Return $sReturn EndFunc ;==>_INetSmtpMailCom_ErrDescription Func _INetSmtpMailCom_ErrScriptLine($iData = Default) Local Static $iReturn = '' If $iData <> Default Then $iReturn = $iData Return $iReturn EndFunc ;==>_INetSmtpMailCom_ErrScriptLine Func _INetSmtpMailCom_ErrFunc() _INetSmtpMailCom_ErrObjInit() _INetSmtpMailCom_ErrHexNumber(Hex(_INetSmtpMailCom_ErrObjInit().number, 8)) _INetSmtpMailCom_ErrDescription(StringStripWS(_INetSmtpMailCom_ErrObjInit().description, 3)) _INetSmtpMailCom_ErrScriptLine(_INetSmtpMailCom_ErrObjInit().ScriptLine) SetError(1); something to check for when this function returns Return EndFunc ;==>_INetSmtpMailCom_ErrFunc #EndRegion UDF Functions Creating this modification, I had to:
      1. Object Error Handler used only for the duration of the function of Use,
      2. Automatic ErrorHandler CleanUp so that previous ErrorHandler took the job.
      3. Ability to get ErrorNumber and ErrorDescription ErrorScriptLine information even after the end of the function
      4. Elimination of most global variables
       
      mLipok
       
      EDIT: attached SmtpMailer_UDF.au3 file
      EDIT 2: Any comments are welcome.
      EDIT 3: Script CleanUp
      EDIT 4: Download moved to "Download Section" (previously downloaded 379 times)

       
       
    • kcvinu
      How can i change the page background color in word
      By kcvinu
      Hi all,
      I am trying to change the background color of a page in word document. But i am getting error. This is my code.
      Local $owObj = ObjGet("","word.application") If @error Then ConsoleWrite("Obj Error " & @CRLF) Local $odoc = $owObj.ActiveDocument Local $colorArray = [136,151,109] ; Olive Green $odoc.Background.Fill.ForeColor.RGB = _ColorSetRGB($colorArray) $odoc.Background.Fill.Visible = True $odoc.Background.Fill.Solid() If @error Then ConsoleWrite("Error in Color change - " & @error & @CRLF) $owObj = 0 ExitAnd this is the error msg
      Error in Color change - -2147352571EDIT : I would like to know about using rgb colors in autoit. 
    • boy233
      Exist UDF to Sharepoint?
      By boy233
      I wanted to know if you have UDF for Sharepoint ?! An example?
    • Quantumation
      How do you make UDF's?
      By Quantumation
      I'm new to scripting and Autoit, but i've already found some things that I would like to create. Where do you start when creating a UDF?
      For instance, if I wanted to make a UDF for Excel(I know one exists) Where would I start? What would I need to start researching?
      Any input would be appreciated