Sign in to follow this  
Followers 0
ForsakenGod

Setting up smtp

19 posts in this topic

Hello ,

I would like to make an automatic update for my programm . What it now does it collects ignored pages (adresses) and put them into an html file line by line and afterwards (if they match criteria) ignores them in next searches. Now i would like to send this *.html file if it reaches for eq. 50 KB it should be send by smtp . The problem is i have absolutely no idea how to do an function that limits if its bigger than 50 kb and i also newer worked with an silent sending via smtp.

Thanks in advance

Unreal

Share this post


Link to post
Share on other sites



Hello ,

I would like to make an automatic update for my programm . What it now does it collects ignored pages (adresses) and put them into an html file line by line and afterwards (if they match criteria) ignores them in next searches. Now i would like to send this *.html file if it reaches for eq. 50 KB it should be send by smtp . The problem is i have absolutely no idea how to do an function that limits if its bigger than 50 kb and i also newer worked with an silent sending via smtp.

Thanks in advance

Unreal

write it to a file and use FileGetSize or StringLen if you want to just get the size of a string, 50 kilobits = 6400 byte so "if StringLen($String) > 6400 then @error"

Share this post


Link to post
Share on other sites

write it to a file and use FileGetSize or StringLen if you want to just get the size of a string, 50 kilobits = 6400 byte so "if StringLen($String) > 6400 then @error"

Oh thanks cool and any idea how to make it send then ?

Func Checker()
While 1
    $size = FileGetSize($file)
        If $size > 6400 Then
            _SMTP here
        EndIf
WEnd
EndFunc

Like this and let it still run right . Thanks any idea how to send it via smtp than ? ;)

Share this post


Link to post
Share on other sites

http://www.autoitscript.com/forum/index.php?showtopic=23860&view=findpost&p=166575

2nd result searching for autoit smtp on the forums

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

http://www.autoitscript.com/forum/index.php?showtopic=23860&view=findpost&p=166575

2nd result searching for autoit smtp on the forums

Thank you ;)) ANd last question :evil: Anyone has an suggestion how to allow 2 function run (the same code ? ) I belive it was somethink with DIM

Edited by ForsakenGod

Share this post


Link to post
Share on other sites

AutoIt doesn't work like that. No multi threading sorry Posted Image

Well afterwards is there some way to make my script work ? ;) Like to example . The programm is collecting web adresses and if the file it creates reaches over 50 kb it should send it delete it and continue ? :evil:

Share this post


Link to post
Share on other sites

Well afterwards is there some way to make my script work ? ;) Like to example . The programm is collecting web adresses and if the file it creates reaches over 50 kb it should send it delete it and continue ? :evil:

FileGetSize(), FileDelete() and then you need to work out the SMTP part provided to you earlier :evil:

Share this post


Link to post
Share on other sites

FileGetSize(), FileDelete() and then you need to work out the SMTP part provided to you earlier ;)

Thanks :evil: Working on it already x)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Global $log = "log.html"

If $velkostsuboru > 1000 Then
        FileClose($log)
        Odoslanie()
    EndIf

I got a little problem . It now checks the size of the file but it cannot be send cause some other pgoramm is using the file already any suggestions ? You see i close the file but anyway ;)

Edited by ForsakenGod

Share this post


Link to post
Share on other sites

would need to see the script

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Global $log = "log.html"
FileWrite($log,"")
FileOpen($log, 1)
Sleep(100)
FileWrite($log, @YEAR & "-" & @MON & "-" & @MDAY)

While 1  ;www data capturing loop here some exeption etc and then it says what to write to log and what not so for ex.
    If 1=1 Then _Adress('adress')
Wend
    
Func Adress($adress)
    FileWrite($log, $adress)
    $velkostsuboru = FileGetSize($log)
    If $velkostsuboru > 1000 Then
        FileClose($log)
        Odoslanie() ;; This function starts the sending
    EndIf
EndFUnc

Here is an short example as sending script i use the one mentioned above .

Thanks in advance

Edited by ForsakenGod

Share this post


Link to post
Share on other sites

Couple of things.

Firstly, it's "address" ;)

Next, this line:

If 1=1 Then _Adress('adress')

Could quite simply be replaced with just:

_Adress('adress')

And next,

FileWrite($log,"")
FileOpen($log, 1)

Is being called the wrong way, it should be:

FileOpen($log, 1)
FileWrite($log,"")

Thanks but anyway ... it still does not want to send the file even if i close it :evil:

Share this post


Link to post
Share on other sites

When it comes to the sending part it says that it cannot attatch the file because other programm is using it but you see that b4 i run the sending func i close the file

Share this post


Link to post
Share on other sites

When it comes to the sending part it says that it cannot attatch the file because other programm is using it but you see that b4 i run the sending func i close the file

Do you mind sharing the script you're using? PM it to me if you don't want public sharing ;)

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

Ok will try out

Edited by ForsakenGod

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
Sign in to follow this  
Followers 0