Jump to content

Recommended Posts

Posted

odd works fine for me; i just edited out my username/pass and email adds

here is the one i used: Thanks again

#Include<file.au3>
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
;##################################
; Include
;##################################
#Include<file.au3>
;##################################
; Variables
;##################################
$s_SmtpServer = "smtp.gmail.com"           ; address for the smtp-server to use - REQUIRED
$s_FromName = "Test"                   ; name from who the email was sent
$s_FromAddress = "email@googlemail.com";  address from where the mail should come
$s_ToAddress = "email@hotmail.co.uk"; destination address of the email - REQUIRED
$s_Subject = "Test"             ; subject from the email - can be anything you want it to be
$as_Body = "This is a test email"                         ; the messagebody from the mail - can be left blank but then you get a blank mail
$s_AttachFiles = ""                 ; the file you want to attach- leave blank if not needed
$s_CcAddress = ""   ; address for cc - leave blank if not needed
$s_BccAddress = ""  ; address for bcc - leave blank if not needed
$s_Username = "username"                 ; username for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
$s_Password = "password"               ; password for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
;$IPPort = 25                          ; port used for sending the mail
;$ssl = 0                              ; enables/disables secure socket layer sending - put to 1 if using httpS
$IPPort=465                      ; GMAIL port used for sending the mail
$ssl=1                            ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS

;##################################
; Script
;##################################
Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
If @error Then
    MsgBox(0, "Error sending message", "Error code:" & @error & "  Rc:" & $rc)
EndIf
;

Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "",$IPPort=25, $ssl=0)
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body,"<") and StringInStr($as_Body,">") Then
        $objEmail.HTMLBody = $as_Body
    Else
        $objEmail.Textbody = $as_Body & @CRLF
    EndIf
    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
                $objEmail.AddAttachment ($S_Files2Attach[$x])
            Else
                $i_Error_desciption = $i_Error_desciption & @lf & 'File not found to attach: ' & $S_Files2Attach[$x]
                SetError(1)
                return 0
            EndIf
        Next
    EndIf
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    $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") = 1
        $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
    If $Ssl Then
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    EndIf
;Update settings
    $objEmail.Configuration.Fields.Update
; Sent the Message
    $objEmail.Send
    if @error then
        SetError(2)
        return $oMyRet[1]
    EndIf
EndFunc;==>_INetSmtpMailCom
;
;
; Com Error Handler
Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    $oMyRet[0] = $HexNumber
    $oMyRet[1] = StringStripWS($oMyError.description,3)
    ConsoleWrite("### COM Error !  Number: " & $HexNumber & "   ScriptLine: " & $oMyError.scriptline & "   Description:" & $oMyRet[1] & @LF)
    SetError(1); something to check for when this function returns
    Return
EndFunc;==>MyErrFunc
Posted (edited)

Couldn't someone just packetlog your username and password when it goes to send the email??

Maybe a specialized smtp server that would accept encrypted tcp packets could interperate the smtp data and use it to send real smtp on a different machine as a fix?

Also, anyone know where to find your paypal link at?

Edited by BackStabbed

tolle indicium

Posted

This was sent to me recently from RiCK_420_333

QUOTE

That code you have is old and no longer works, but i finally figured out how to create my own,

so if anyone else asks you this, this is how it's done:

Login to Paypal, go to Merchant Services, click Create Button (even though you don't want a button),

go through the process of creating a button, make sure to check the option to not encrypt it,

then upon finishing the button it gives you the button code + an e-mailable link (which is the one we need for Xprotec).

I hope this will help other people to avoid the confusion I was finding in looking for how to do this.

Peace,

RiCK

That is how you find your paypal link!

This was originally sent to me from Valuater.

tolle indicium

  • 1 month later...
Posted

Valuater & Jos, you guys are GODS!!!

I can't tell you how easy you've made it for a newbie like me to protect my script. And it's just too 8) for words! So simple & elegant. I really want to thank you Valuater for all the hard work you put into this... and to Jos for the original SMTP script. I'm planning to promote my script in a couple of days and from whatever sales I make, I'd like to pledge half of my profits to the AutoIt team. I wouldn't have been able to achieve my goal if it weren't for this amazing script language you guys have created,

Valuater - I just added a few changes to the XProtec include to allow for the validation emails to be sent via Gmail. Works perfectly!!!

Global $smtpserver = "smtp.gmail.com"
......
......
......
      
        .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 ;Port 25 for normal smtp
        .Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True

THANK YOU SO MUCH ONCE AGAIN!

Posted

Valuater & Jos, you guys are GODS!!!

I can't tell you how easy you've made it for a newbie like me to protect my script. And it's just too 8) for words! So simple & elegant. I really want to thank you Valuater for all the hard work you put into this... and to Jos for the original SMTP script. I'm planning to promote my script in a couple of days and from whatever sales I make, I'd like to pledge half of my profits to the AutoIt team. I wouldn't have been able to achieve my goal if it weren't for this amazing script language you guys have created,

Valuater - I just added a few changes to the XProtec include to allow for the validation emails to be sent via Gmail. Works perfectly!!!

Global $smtpserver = "smtp.gmail.com"
 ......
 ......
 ......
       
         .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465;Port 25 for normal smtp
         .Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True

THANK YOU SO MUCH ONCE AGAIN!

Well, I don't know about "GODS" but, I am glad you are able to make great use of it. Believe me, Jos and Gary Frost are still "GODS" to me. Please let us know how this ends up for your program.

Thanks... and Welcome too!

8)

NEWHeader1.png

  • 2 months later...
Posted

To prevent people from fudging the system date on their end, does this program check the date on the server and compare if it is within a 48 hour period either side of that (to allow for slow servers and daylight savings and different time zones)?

Posted (edited)

To prevent people from fudging the system date on their end, does this program check the date on the server and compare if it is within a 48 hour period either side of that (to allow for slow servers and daylight savings and different time zones)?

Actually no....

However, You the developer are sent an email immediately at validation ( before use ) and have a server time sent to you for checking against the user's computer generated validation date inside the email

"Validation Date = " & _DateTimeFormat( _NowCalc(), 1)

This is an actual email example

My_Program_Name Validation Code

From:My_Program_Name@ClickTask.com

To:sadasd@sadaasd.com

Cc:Me**@csn.com

Date Tue, 11 Nov 2008 3:17 am *** SERVER

Please copy the Validation Code below

Owner = *

Program = My_Program_Name

Validation Date = 11 November 2008 Tuesday *** User's Computer Generated

Validation Code = E220-N355-G371-H527

Thank You!

My_Program_Name

The Validation code must be used at that time or the program must be restarted and a new code will be generated

8)

Edited by Valuater

NEWHeader1.png

  • 1 month later...
Posted

Hello!

I from Ukraine, i speak english bad

I need protect my program from free usage.

I have found this page. I download XProTec.au3, include in my script and compile, but I not understand as it work.

After start program I enter the e-mail. I recive code and enter it in field. Then the program has suggested to pay.

After push on the button the program has passed to a site http://www.dreamhost.com/donate.cgi? id=2933.

In my country for payment used only WebMoney system, nobody uses system PayPal.

Help me please with following questions:

- as I can use for payment the link http://www.oplata.info/asp/pay_wm.asp? id_d=664754?

- How much I have understood after payment the buyer should receive a code which after input in the program does of it the full version. Where I can take this code to give to its buyer?

Posted

hi all... BTW and first of all... GREAT JOB! CONGRATS!! :)

I'm kinda new in AutoIt, but already passioned by!

ok... for some "com error" some people talk about here, i have them too in this computer, then i try it on another computer and program run with no problem at all. Turns out that is a computer error (your computer) and not a script's error.

Maybe a windows configuration error, or if you have, like me, an altered windows (i have the XP SP3 DX10 Gamers edition in this PC)... and btw u can't install printers, also Outlook have problems in this version of windows so.... its windows error, not the script. :S

ok, so MY question about this great program, is:

- What will happen after the end of the trial time? I've altered the date of my test pc so i could see... he open my paypal link, but for (temporary i hope ^_^) financial reasons, i cant make the payment, so i'm asking here

- What is the XProtec procedure after the payment?

- Does he "see" people making the payment, or does he give another 30 day (or whatever time we chose) use time?

- Or do he send an email to us devs so we can send a final code? If so, how do we get that code?

I've read the all post and unless i miss something (pardon me if so) there is nothing said about that.

Note: As soon i start making some profit with my program's sellings, my finnancial problems (the ones i've explained before :huh2:) will end, and i'll be glad to donate here guys, u earned that!

Keep Up this great job and sorry for some bad English. Cheers :)

Posted

Hi Magician,

Reading all the material and asking good questions deserves an answer. I, the developer of XProTec, am out of the process since the free version was released. Bear in mind that this information was correct at the time of release.

1. When the user makes the payment at Paypal online, the title on paypal will change to "Thank you for your payment"

(as of date of release)

2. XProtec will recognize the paid title and automatically create a "Registration" input box and send an email immediately. (just like the original "Validation")

3. The user will enjoy immediate use as a paid user. You the developer will receive an immediate email from XProtec showing "Registration" and another email from Paypal showing you got paid.

Hope that helps

Valuater

8)

NEWHeader1.png

Posted

Thax Valuater, for you FAST reply :)

Once more, i soddenly start having all but COM errors in all my test computers... turns out that seems to me that it has something to do with gmail and/or ssl connections, because i try it out on gmail and it was ok then today it was not ok... but then i test gmail smtp with outlook and there was errors in connection....... gmail? not connecting with smtp? possible... anyway, i've set up a gmx account and tested... same thing... but little different, same error in xprotec, but diferent on outlook and the jos's stand alone mailer... error code 2... then i've set up my isp smtp, and all is running smoothly :)

Didn't find out if it was a gmail/gmx smtp server error, or if it is because i'm using a router, or because my isp need a dns addres... no matter anyway. ^_^

Its working!! again!! :huh2: although strange that one day is ok and the other come with these errors....

But, Once again, is NOT your script errors. so all these m8s have to dig deeper (like i did) to find what is causing their error.

OK, my "just one more question" is: :lmao:

- If at some point i want to make an update to my script or a bug fix... anything, i just have to provide the file with same name of the first and the script users only have to copy the file to same folder, replacing the old one, am i rong?

I mean...

I make all necessary changes to my .au3 file, then i compile the new file with xprotec.

A already validated/licensed user will not have to register/pay again if he copy the file to same folder thus replacing the old file. Is this the way it work for updates using Xprotec?

Posted

ok i have confirmed already, it works fine just have to be same name.

Thx for your great job once again :)

Thanks, just noticed the "two" posts

Glad you found the needed answer, Good Luck!!

Valuater

8)

NEWHeader1.png

  • 2 weeks later...
  • Developers
Posted

I Dont Have website... I dont Understand about $D_PayPal.... But I want Protect my app with xprotect.... please help me....

I am wondering what kind of magic you would like to perform when you don't want to work with a generated key, Website etc ... and still want to limit the use of a program license to a single PC per bought license.

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.
  :)

  • 1 month later...
Posted

Hi All,

This is my first post on the forum so you have to bear with me. I have a nifty little program which I would like to make commercial and I came across this great code which can help me out. Only thing is I got no idea how to use it. There is also the smtp code on another post and I just dont know how to put the two together. I just need help getting the 2 together. Do I replace the email part of the xprotec code with the smtp code or what???

How do I exactly set it up. What do I have to put into my code and what do I have to change in the SMTP and xprotec code to make this work.

Any help would be much appreciated.

Justin

  • Moderators
Posted

Hi All,

This is my first post on the forum so you have to bear with me. I have a nifty little program which I would like to make commercial and I came across this great code which can help me out. Only thing is I got no idea how to use it. There is also the smtp code on another post and I just dont know how to put the two together. I just need help getting the 2 together. Do I replace the email part of the xprotec code with the smtp code or what???

How do I exactly set it up. What do I have to put into my code and what do I have to change in the SMTP and xprotec code to make this work.

Any help would be much appreciated.

Justin

Welcome to the forum ^_^

And you read through the other 5 pages to see if your issue was already addressed?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Welcome to the forum ^_^

And you read through the other 5 pages to see if your issue was already addressed?

I have gone through them more carefully and I was able to resolve the issues I was having. I was able to get a validation code for my personal email from my product's email. Im just not sure how to set up buttons to get the user to buy the program or register the program etc.

Posted

I have gone through them more carefully and I was able to resolve the issues I was having. I was able to get a validation code for my personal email from my product's email. Im just not sure how to set up buttons to get the user to buy the program or register the program etc.

Have you got to the PayPal part yet?

$D_PayPal = "www.paypal.com/my account-link to paypal" ; - paypal link

get the actual link from your paypal account.

8)

NEWHeader1.png

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
  • Recently Browsing   0 members

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