Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to Xbox Chaos: Modding Evolved

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

karnage953

Visual Basic
Help Me Please.

6 posts in this topic

So when I made an emailer. This is what it looks like:

test.png

I had this as the code:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim smtpServer As New SmtpClient()
ProgressBar1.Value = +7.5
Dim mail As New MailMessage
ProgressBar1.Value = +15
smtpServer.Credentials = New Net.NetworkCredential("[email protected]", "My password is here, but I don't want u guys knowing it ")
ProgressBar1.Value = +20
smtpServer.Port = 587
ProgressBar1.Value = +30
smtpServer.Host = "smtp.web.de or smtp.gmail.com"
ProgressBar1.Value = +40
smtpServer.EnableSsl = True
ProgressBar1.Value = +50
mail = New MailMessage()
ProgressBar1.Value = +55
mail.From = New MailAddress("[email protected]")
ProgressBar1.Value = +56
mail.To.Add(TextBox1.Text)
ProgressBar1.Value = +60
mail.Subject = TextBox2.Text
ProgressBar1.Value = +75
mail.Body = TextBox3.Text
ProgressBar1.Value = +85
smtpServer.Send(mail)
ProgressBar1.Value = +100
MsgBox("Mail Sent !")
If MsgBoxResult.Ok Then
ProgressBar1.Value = 0
End If

When I send an email I get this:

test2-1.png

If you know how to fix this please reply :)

Share this post


Link to post
Share on other sites

This is Visual Basic .NET, not C++.

I've never worked with sending mail from a .NET program, but you can try wrapping that smtpServer.Send(mail) line in a try...catch block and displaying a MessageBox with the exception converted to a string. It will tell you what went wrong.

Share this post


Link to post
Share on other sites

I know this is super old, but I just read it now, so this is really for the benefit of someone with a similar issue and seeing as no one else has posted a solution I thought I would way in.

 

It has been a while since I programmatically sent mail, but I swear the SMTP port should be 25

Share this post


Link to post
Share on other sites

I know this is super old, but I just read it now, so this is really for the benefit of someone with a similar issue and seeing as no one else has posted a solution I thought I would way in.

 

It has been a while since I programmatically sent mail, but I swear the SMTP port should be 25

What a bump.  I almost thought Karnage was active again :o.  Anyways, SMTP can be on any port really and it typically isn't 25 anymore because of additions of TLS or SSL

Share this post


Link to post
Share on other sites

What a bump.  I almost thought Karnage was active again :o.  Anyways, SMTP can be on any port really and it typically isn't 25 anymore because of additions of TLS or SSL

 

Hmm idk then. Maybe something off with "smtp.web.de or smtp.gmail.com". Should the 'or' be part of the literal? Not sure. Never use VB anyway.

Edited by Saint Dickolas

Share this post


Link to post
Share on other sites