Mail program help
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
6 posts
Page 1 of 1
Hello i am currently buildling an application that uses gmail and on the computer it is built on no problems at all work fine not a single error but the second i run it on ANY other computer weather i am loged into that gmail account or not i get this error
![Image]()
I really need to get this fixed as it is the last known issue in my program and then its just working on graphics and it will be finished.

I really need to get this fixed as it is the last known issue in my program and then its just working on graphics and it will be finished.
What is code for line 25 of form1 and is it a button click? the problem is with that line it looks like from error. @ #muttley1968
I don't know if i can help but i am willing to try
I don't know if i can help but i am willing to try

<a href="http://www.points2shop.com/s/xbox_point ... 5082"><img src="http://points2shop.com/images/promotion ... ricoxg.gif" border="0"/></a>
This is the code for the hole button of which the
mail.send section is line 25 of my code
only diffrence between this code and my program is that i have removed my pass and put it to 12345 so you dont know my actaull password
mail.send section is line 25 of my code
only diffrence between this code and my program is that i have removed my pass and put it to 12345 so you dont know my actaull password
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
SmtpServer.Credentials = New _
Net.NetworkCredential("xprograming.manning516@gmail.com", "12345")
SmtpServer.Port = 587
SmtpServer.Host = "smtp.gmail.com"
mail = New MailMessage()
mail.From = New MailAddress(TextBox2.Text)
mail.To.Add("xprograming@gmx.co.uk")
mail.Subject = "Test Mail"
mail.Body = ((Label1.Text + TextBox1.Text) & vbCrLf & (Label2.Text + TextBox2.Text) & vbCrLf & (Label3.Text + TextBox3.Text) & vbCrLf & (Label4.Text + TextBox4.Text))
PictureBox3.Image.Save(ms, ImageFormat.Png)
ms.Position = 0
mail.Attachments.Add(a)
SmtpServer.Send(mail)
MsgBox("mail sent")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
try to add
example:
http://geekswithblogs.net/TakeNote/arch ... 13974.aspx
Code: Select all
to your code since you are using Gmail.com
Mail.EnableSsl = True
example:
Code: Select all
Refference Link:Imports System.Net.Mail
'Start by creating a mail message object
Dim MyMailMessage As New MailMessage()
'From requires an instance of the MailAddress type
MyMailMessage.From = New MailAddress("from_address_here@gmail.com")
'To is a collection of MailAddress types
MyMailMessage.To.Add("to_address_here@domain_name_here")
MyMailMessage.Subject = "GMail Test"
MyMailMessage.Body = "This is the test text for Gmail email"
'Create the SMTPClient object and specify the SMTP GMail server
Dim SMTPServer As New SmtpClient("smtp.gmail.com")
SMTPServer.Port = 587
SMTPServer.Credentials = New System.Net.NetworkCredential("account uid", " account pwd")
SMTPServer.EnableSsl = True
Try
SMTPServer.Send(MyMailMessage)
MessageBox.Show("Email Sent")
Catch ex As SmtpException
MessageBox.Show(ex.Message)
End Try
http://geekswithblogs.net/TakeNote/arch ... 13974.aspx
You may be missing SSL because I remember gmail being a rite pain for sending mail. Try adding this within the code:
P.S. Scottie beat me to it while I was typing out my reply :lol:
Code: Select all
I think thats what it was :?SmtpServer.EnableSsl = true
P.S. Scottie beat me to it while I was typing out my reply :lol:
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
thanks everyone that seems to have done the trick its a tab bit slow but ill just add a progressbar so people know it hasnt frozen
6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023