[Question]E-mail(Bug Report)

Posts 1–15 of 20 · Page 1 of 2
[Question]E-mail(Bug Report)
How would i make a Submit bug form ? i have a code below but it wont work


[php]Imports System.Net.Mail
Public Class SubmitBug

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Increment(1)
If ProgressBar1.Value = ProgressBar1.Maximum Then
Dim WC As New System.Net.WebClient
Dim MyMailMessage As New MailMessage

MyMailMessage.To.Add("submitbug@gmail.com")
MyMailMessage.Subject = (TextBox2.Text)
WC.Dispose()
MyMailMessage.Body = (RichTextBox1.Text)
Dim SMTPServer As New SmtpClient("smtp.gmail.com")
SMTPServer.Credentials = New System.Net.NetworkCredential("Nexgen1: Removed Email", "Nextgen1: Removed Password")
SMTPServer.EnableSsl = True

Try
SMTPServer.Send(MyMailMessage)

Catch ex As SmtpException


Catch ex As Exception

End Try
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MsgBox(" Please Visit mpgh.net For The Best VIP Hacks, Pub Hacks + More", MsgBoxStyle******rmation + MsgBoxStyle.OkOnly)
Me.Close()
End Sub


Private Sub TextBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.Click
TextBox1.Text = ""
End Sub

Private Sub TextBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.Click
TextBox2.Text = ""
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
System.Diagnostics.Process.Start("http://mpgh.net")
End Sub
End Class[/php]
I caught the error, it is authentication based, One sec, Revising
Actually you forgot to input the port for Google SMTP server that is: 587

[php]Try
Dim msg As New MailMessage(senderID.Text, recievers.Text, subj.Text, emailbody.Text)
If Not CCs.Text = vbNullString Then
msg.CC.Add(CCs.Text)
End If
If Not BCCs.Text = vbNullString Then
msg.Bcc.Add(BCCs.Text)
End If

If attachments.Items.Count > 0 Then
For Each z As String In attachments.Items
msg.Attachments.Add(New Net.Mail.Attachment(z))
Next
End If
Dim client As New SmtpClient("smtp.gmail.com", 587)
Dim Credentials As New System.Net.NetworkCredential(senderID.Text, pass.Text)


client.Credentials = Credentials

client.EnableSsl = True

client.Send(msg)
Catch ex As Exception
MsgBox("Error sending email !!" & vbCrLf & ex.Message)
Exit Sub
End Try

MsgBox("Your email has been sent.")[/php]

Tested and working fine here


A. Tried that with his code already, that what was in my edit above as a suggestion

B. Error coming back on your code and mine is

5.1.1 authnetication, I have tried your code, (typical) My Code (heavily modified and above code.

C. Port 587 is now default and will work on a smtp relay without adding it, though it is a good idea to have if they every change their requirements for ssl

But then again, with that said, I am using his credentials, I don't know if they are correct or not.

Quote Originally Posted by NextGen1 View Post


A. Tried that with his code already, that what was in my edit above as a suggestion

B. Error coming back on your code and mine is

5.1.1 authnetication, I have tried your code, (typical) My Code (heavily modified and above code.

C. Port 587 is now default and will work on a smtp relay without adding it, though it is a good idea to have if they every change their requirements for ssl

But then again, with that said, I am using his credentials, I don't know if they are correct or not.

The code I posted above is running perfectly fine.
They problem is with the credentials !!
Maybe, I logged into the account, then I told him he posted his credentials, Maybe he changed them, I Pm(ed) him , No response, But meh

The answer is here and out there.
I have the correct code on my other comp. I cant get to it now though
username and pass still the same. still cant get it to work tho ( The Code)

i copyied and pasted nexgen1 Modifyed code and got this error

[php]A first chance exception of type 'System.InvalidOperationException' occurred in System.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.dll[/php]
Quote Originally Posted by Shocker2010 View Post
username and pass still the same. still cant get it to work tho ( The Code)

i copyied and pasted nexgen1 Modifyed code and got this error

[php]A first chance exception of type 'System.InvalidOperationException' occurred in System.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.dll[/php]
Did MJ's work?

Didn't work for me, just seeing if we can get this working, All of the codes here, including the original one I posted for you are correct.
i used MJ's but i dont have CCs BCCs and the

Catch ex As Exception - had a blue highlight line under it

Here : All Red lines is where an error is

YESSS I GOT IT WORKING. Nextgen1 please close this

EDIT : its nto working, i tried to send it from my other gmail acc but it wont work.. i can only use the supplied email address!!


also when i send a message it keeps sending it, how can i make it send once??

Code im NOW using

[php]Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Increment(1)
Dim msg As New MailMessage(senderID.Text, recievers.Text, subj.Text, emailbody.Text)
If Not CCs.Text = vbNullString Then
msg.CC.Add(CCs.Text)
End If
If Not BCCs.Text = vbNullString Then
msg.Bcc.Add(BCCs.Text)
End If


Dim client As New SmtpClient("smtp.gmail.com", 587)
Dim Credentials As New System.Net.NetworkCredential(senderID.Text, pass.Text)


client.Credentials = Credentials

client.EnableSsl = True

client.Send(msg)



MsgBox("Your email has been sent Thank you for taking the Time To Notify me there's a bug | Credits to MJLover For The Source Code For The Submit Bug|.")

Timer1.Stop()
Timer1.Enabled = False[/php]
Quote Originally Posted by Shocker2010 View Post
YESSS I GOT IT WORKING. Nextgen1 please close this

EDIT : its nto working, i tried to send it from my other gmail acc but it wont work.. i can only use the supplied email address!!


also when i send a message it keeps sending it, how can i make it send once??

Code im NOW using

[php]Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Increment(1)
Dim msg As New MailMessage(senderID.Text, recievers.Text, subj.Text, emailbody.Text)



Dim client As New SmtpClient("smtp.gmail.com", 587)
Dim Credentials As New System.Net.NetworkCredential(senderID.Text, pass.Text)


client.Credentials = Credentials

client.EnableSsl = True

client.Send(msg)



MsgBox("Your email has been sent Thank you for taking the Time To Notify me there's a bug | Credits to MJLover For The Source Code For The Submit Bug|.")

Timer1.Stop()
Timer1.Enabled = False[/php]
Remove
Code:
ProgressBar1.Increment(1)
to send just 1 time.

Also remove the following lines incase you don't want carbon and blind carbon copy:
Code:
If Not CCs.Text = vbNullString Then
            msg.CC.Add(CCs.Text)
        End If
        If Not BCCs.Text = vbNullString Then
            msg.Bcc.Add(BCCs.Text)
        End If
Thnx !!
ok thanks MJ.. i also give u credits

/edit it still send it more then once.. i removed the things what u said MJ
Quote Originally Posted by Shocker2010 View Post
ok thanks MJ.. i also give u credits

/edit it still send it more then once.. i removed the things what u said MJ
Post your complete module once more. Plz !!
[php]Imports System.Net.Mail
Public Class SubmitBug

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Dim msg As New MailMessage(senderID.Text, recievers.Text, subj.Text, emailbody.Text)
Dim client As New SmtpClient("smtp.gmail.com", 587)
Dim Credentials As New System.Net.NetworkCredential(senderID.Text, pass.Text)


client.Credentials = Credentials

client.EnableSsl = True

client.Send(msg)



MsgBox("Your email has been sent Thank you for taking the Time To Notify me there's a bug | Credits to MJLover For The Source Code For The Submit Bug|.")

Timer1.Stop()
Timer1.Enabled = False
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MsgBox(" Please Visit mpgh.net For The Best VIP Hacks, Pub Hacks + More", MsgBoxStyle******rmation + MsgBoxStyle.OkOnly)
Me.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
System.Diagnostics.Process.Start("http://mpgh.net")
End Sub
Private Sub Label11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label11.Click
Form1.Show()
Me.Hide()
End Sub
Private Sub Subj_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Subj.Click
Subj.Text = ""
End Sub
End Class[/php]
Posts 1–15 of 20 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?