Automatically click on links in incoming mails

D

dominik

Hi,

imagine this scenario:

I use a server based script to submit picture galleries to another
server. This happens some times a day. Now this server server sends an
e-mail to me, asking me to confirm, that it really was me, who
submitted these galleries. In that e-mail there is an url that I need
to click on. Something like:

http://www.example.com/confirm.x3ml?blablablabla-sessionid-blabla

Currently I have to click this link manually every time, and that's not
as automated as I'd like to have.

I experimented a little bit with VBA in my Outlook client, but it
didn't seem to do anything at all. I think I tried to implement
Application_NewMail. Had to reinstall my computer though and forgot to
make a backup of my function ;)

Is there a simple solution to my problem?

Tks,
Dominik
 
B

BlaM

Hi again,

found an answer myself:

Private Declare Function URLDownloadToFile Lib "urlmon.dll" Alias
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String,
ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As
Long) As Long

Public Function DownloadFile(URL As String, LocalFileName As String) As
Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFileName, 0, 0)
DownloadFile = (lngRetVal = 0)
End Function

Sub ClickX3ScriptsLink(MyMail As MailItem)
Dim x
x = InStr(MyMail.Body,
"http://www.x3scripts.com/tgp/confirm.x3ml?")
If x > 0 Then
URL$ = Mid(MyMail.Body, x)
x = InStr(URL$, Chr$(13))
URL$ = Trim(Left(URL$, x - 1))
DownloadFile URL$, Environ("TEMP") & "\x3.tmp"
MyMail.Body = MyMail.Body & Chr(13) & Chr(13) & "done"
End If
End Sub

And then call "ClickX3ScriptsLink" by a rule.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top