Jump to content

How to reterive a link from message in inbox


shiv
 Share

Recommended Posts

Hi All,

I have used your pop3 script in my code.

I have used the pop3 function to know whether the message is in inbox or not

I just want to know how can i retrieve any URL from that message

I have used the following function to do that

$URL = http://yahoo.com
Local $Link =  "<=?h=?t=?t=?p=?:=?/=?/=?(.*?)" & @CRLF & "(.*?)>"
            $Array = StringRegExp($sRet, $Link , 2)
            $Link = StringReplace($aArray[0], "=" & @CRLF, "")
            $aArray = StringRegExp($Link, $URL, 2)
            If UBound($aArray) <> 0 Then
                $sRemark = "PASS"
                Msgbox(o,o,link is verified”)
            Else
                $sRemark = "FAIL"
                Msgbox(o,o,link is not verified”) 
            EndIf

But when i run this function i get the error "array variable used with incorrect no of subscript".[if there is any mistake please correct me]

However if i make the comment for two line of code written below no error is received

$Link = StringReplace($aArray[0], "=" & @CRLF, "")
$aArray = StringRegExp($Link, $URL, 2)

. but statement

$sRemark = "FAIL"
 Msgbox(o,o,link is not verified”)

 is executed

Well the above mentioned seems confusing .

But my main motive is to retrieve the Link from the message

Link to comment
Share on other sites

You show us there is a problem with getting an array from StringRegExp using $Ret, but you don't let us know what $Ret is.

After executing StringRegExp with Flag = 1 or 2 :

@Error Meaning

0 Array is valid. Check @Extended for next offset

1 Array is invalid. No matches.

2 Bad pattern, array is invalid. @Extended = offset of error in pattern.

 

You must see what @Error is after calling SrtingRegExp so you can see what is going wrong. Use the help file before asking people for help. Add code to your scripts to catch problems and don't assume a variable is an array just because you want it to be. Then when you have done that and still can't understand what is wrong, please give enough information to allow people to help. It takes time to help people so show some respect and take the time yourself to present a well thought out description of the problem, give all the information and preferably some code which demonstrates what goes wrong and which we can run.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

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