|
-
Sep 1st, 2009, 12:04 PM
#1
Thread Starter
Junior Member
How to send Emails
I'm making a program with visual basic 2008 express edition that the user needs to enter his/her email address. I need a way of sending them an email containing nothing fancy just a subject and a body. I can send emails to google mail email address using the smpt but nobody else. I there a way to send an email to someone no matter what email domain they have. Also when this email is sent I need to send an email to me (Removed By Mod)
How can I do this?
Bye
Last edited by Hack; Sep 1st, 2009 at 12:56 PM.
Reason: Removed EMail Address
-
Sep 1st, 2009, 12:06 PM
#2
Re: How to send Emails
Did you search the forum? This question gets asked and answered a lot here.
-
Sep 1st, 2009, 12:07 PM
#3
Re: How to send Emails
Use the System.Net.Mail namespace. It has all the methods to create and send emails.
-
Sep 1st, 2009, 12:13 PM
#4
Re: How to send Emails
and I would edit the OP to exclude the actual email address. Spammers will eat that up in a heartbeat.
-
Sep 1st, 2009, 12:56 PM
#5
Re: How to send Emails
I have edited your post and removed your email address.
You should never post your email address in an open post on an open forum. Mail spam bots can pick that up and before you know it, your mailbox is full of junk mail. If you wish to share your email address with other forum members, please do so via our PM system.
In addition, we prefer all answers to questions be publically posted rather than sent via EMail or PM. That way, everyone with a similar problem can benefit.
Thanks.
-
Sep 3rd, 2009, 02:10 AM
#6
Addicted Member
Re: How to send Emails
Hi,
A few days ago I've made the same thing.
This is the code I've used:
vb.net Code:
Imports System.Net.Mail
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyMailMessage As New MailMessage()
Try
MyMailMessage.From = New MailAddress("@@@")
MyMailMessage.To.Add("@@@")
MyMailMessage.Subject = "@@@"
MyMailMessage.Body = "Name" & vbTab & ": " & Name.Text & vbNewLine
Dim SMTP As New SmtpClient("@@") 'put in you providers SMTP server
SMTP.EnableSsl = False
SMTP.Credentials = New System.Net.NetworkCredential("@@@", "@@@") '1st @@@ emailaddess 2nd @@@ password
SMTP.Send(MyMailMessage)
MessageBox.Show("Mail send", MsgBoxStyle.Information, "Information")
Catch ex As Exception
End Try
Although (as far as I know) it depends on your providers SMTP and if they allow to send mails at port 25. My provider only let me send SMTP mail through their smtp address. So if you want to be able to send from different places be sure to adjust the SMTP address.
Again, if i'm wrong, love to hear it.
Paul
Last edited by Hakka; Sep 3rd, 2009 at 06:51 AM.
Reason: typo
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|