Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by NextGen1 View Post
    Hmmm, if error message is on sending, then try SMTP port 465
    Its not on sending it just says that the string is not recognized as a valid email address the label works right, and the email downloads fine so
    Ik i bumped its just ive had midterms last week so i couldnt really get on

  2. #17
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Bombsaway707 View Post

    Its not on sending it just says that the string is not recognized as a valid email address the label works right, and the email downloads fine so
    Ik i bumped its just ive had midterms last week so i couldnt really get on
    Then you just need to look for invalid characters and remove them. Did you tried Trim Method ? Also, you sure the Target file has only 1 email address :P
    Last edited by Hassan; 01-10-2011 at 05:06 PM.

  3. #18
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Code:
    Private Sub Emaillocation()
            Dim Target As String
            Target = "http:/**********/*****/Target.txt"
            Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(Target)
            Dim response As System.Net.HttpWebResponse = request.GetResponse()
            Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("windows-1252"))
            Dim Targettxt As String
            Targettxt = sr.ReadToEnd()
            TargetX.Text = Targettxt
          Call email()
        End Sub
    
    Private Sub email()
            Dim AnEmailMessage As New MailMessage
            AnEmailMessage.From = New MailAddress("************@gmail.com")
            Dim mailTo As String = TagetX.Text
            AnEmailMessage.To.Add(mailTo)
            AnEmailMessage.Subject = ("**************")
            AnEmailMessage.Body = ("*****************************")
            Dim SimpleSMTP As New SmtpClient("smtp.gmail.com")
            SimpleSMTP.Port = 587
            SimpleSMTP.EnableSsl = True
            SimpleSMTP.Credentials = New System.Net.NetworkCredential("**************@gmail.com", "******")
            SimpleSMTP.Send(AnEmailMessage)
        End Sub
    What we really need you to do is put a breakpoint on the highlighted line, then when the program breaks there, hover your mouse over the "mailTo" variable and check it's value.

    Otherwise, you can try this (very general Regex, could not be fucked trying to type out a more specific one because you're already working with an email address, you just need to make sure it's correct. You will need to import the System.Text.RegularExpressions namespace for this to work.)

    [php]
    Dim NewReg As New Regex("\b.*?@.*\b")
    If NewReg.IsMatch(targetX.Text) Then
    AnEmailMessage.To.Add(NewReg.Match(targetX.Text).V alue)
    Else
    MessageBox.Show(String.Concat("There was an invalid email address found!", New String(ControlChars.CrLf, 2), targetX.Text) , "Error: Invalid Email", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
    Exit Sub
    End If
    [/php]
    Last edited by Jason; 01-10-2011 at 08:44 PM.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  4. #19
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by Hassan View Post


    Then you just need to look for invalid characters and remove them. Did you tried Trim Method ? Also, you sure the Target file has only 1 email address :P
    Yep im only sending it to 1 email address


    Quote Originally Posted by Jason View Post
    Code:
    Private Sub Emaillocation()
            Dim Target As String
            Target = "http:/**********/*****/Target.txt"
            Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(Target)
            Dim response As System.Net.HttpWebResponse = request.GetResponse()
            Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("windows-1252"))
            Dim Targettxt As String
            Targettxt = sr.ReadToEnd()
            TargetX.Text = Targettxt
          Call email()
        End Sub
    
    Private Sub email()
            Dim AnEmailMessage As New MailMessage
            AnEmailMessage.From = New MailAddress("************@gmail.com")
            Dim mailTo As String = TagetX.Text
            AnEmailMessage.To.Add(mailTo)
            AnEmailMessage.Subject = ("**************")
            AnEmailMessage.Body = ("*****************************")
            Dim SimpleSMTP As New SmtpClient("smtp.gmail.com")
            SimpleSMTP.Port = 587
            SimpleSMTP.EnableSsl = True
            SimpleSMTP.Credentials = New System.Net.NetworkCredential("**************@gmail.com", "******")
            SimpleSMTP.Send(AnEmailMessage)
        End Sub
    What we really need you to do is put a breakpoint on the highlighted line, then when the program breaks there, hover your mouse over the "mailTo" variable and check it's value.

    Otherwise, you can try this (very general Regex, could not be fucked trying to type out a more specific one because you're already working with an email address, you just need to make sure it's correct. You will need to import the System.Text.RegularExpressions namespace for this to work.)

    [php]
    Dim NewReg As New Regex("\b.*?@.*\b")
    If NewReg.IsMatch(targetX.Text) Then
    AnEmailMessage.To.Add(NewReg.Match(targetX.Text).V alue)
    Else
    MessageBox.Show(String.Concat("There was an invalid email address found!", New String(ControlChars.CrLf, 2), targetX.Text) , "Error: Invalid Email", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
    Exit Sub
    End If
    [/php]
    Thanks, ill try this once i get free time to work on my program

Page 2 of 2 FirstFirst 12