|
-
Jun 30th, 2005, 02:54 PM
#1
Thread Starter
Banned
Send Text To Email
I made a windows form with a couple of text boxes. I want the user to click a send button and it automaticly sends it to my email without opening external programs such as outlook, etc. How would i do this?
-
Jun 30th, 2005, 03:01 PM
#2
Re: Send Text To Email
you generally can't as there is no way to tell what mail they use, and if you can access their outgoing SMTP server to send email. Generally what I do in situations like this, is I would transmit data to a webpage, which would actually do the emailing, this way the only thing required of the end user is an internet connection. You pass the data using .net objects to the ASP or ASP.NET page, and it collects the data and emails it to you.
This solution requires that you have a webhost, and one that has an email activeX (or similar) control that allows sending email via code. Most .NET or ASP hosts do allow that.
-
Jun 30th, 2005, 03:05 PM
#3
Hyperactive Member
Re: Send Text To Email
what if you have a password and a username and every needed information about outgoing SMTP? is there a way to do it in vb.net?
-
Jun 30th, 2005, 03:10 PM
#4
Re: Send Text To Email
yes.
check out the 101 vb.net examples (sticky at the top of the .net forum)
there is an example in there called "NET Framework - How-To Send Mail"
that should give you everything you need. Its a full example app.
-
Jun 30th, 2005, 03:29 PM
#5
Hyperactive Member
-
Aug 24th, 2005, 09:12 AM
#6
Hyperactive Member
Re: Send Text To Email
kleinma,
On my XP system, I was trying this example and found straight off that I don't have SMTP Service installed on my machine. Reading the Readme.htm, I try to find it by looking at Start | Control Panel | Administrative Tools | Internet Information Services, but I don't see Internet Information Services in Administrative Tools (perhaps hidden by our wonderful IT guys).
How can I find the info I need in order to get this example running?
EDIT: Looks like I may not have IIS installed according to this.
http://www.webwizguide.com/asp/tutor..._winXP_pro.asp
Last edited by fdunford; Aug 24th, 2005 at 09:17 AM.
-
Aug 24th, 2005, 09:23 AM
#7
Re: Send Text To Email
do you have windows XP Pro? if so its really easy to install IIS onto your system... if you DO NOT have Pro and have home, then it does not come with IIS
which do you have?
-
Aug 24th, 2005, 12:43 PM
#8
Frenzied Member
Re: Send Text To Email
At the top of your form...
Put this in your event.
Subject is a string.
emaillist is a string
VB Code:
'Use SMTP
Dim mail As New MailMessage
With mail
.To = EmailList
.Subject = Subject
.BodyFormat = MailFormat.Html
.Body = Content
.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "25") 'Put port number here
End With
System.Threading.Thread.Sleep(200)
SmtpMail.SmtpServer = "122.122.122.122" 'your real server goes here
System.Threading.Thread.Sleep(200)
SmtpMail.Send(mail)
If you find my thread helpful, please remember to rate me 
-
Aug 24th, 2005, 01:40 PM
#9
Hyperactive Member
Re: Send Text To Email
 Originally Posted by kleinma
do you have windows XP Pro? if so its really easy to install IIS onto your system... if you DO NOT have Pro and have home, then it does not come with IIS
which do you have?
XP Pro, but have no CD's. If still possible, please tell.
-
Aug 24th, 2005, 01:48 PM
#10
Hyperactive Member
Re: Send Text To Email
 Originally Posted by dinosaur_uk
I can import System.Web, but Mail is not there? Using Help-About I have Microsoft Development Environment V 7.1.3088 and .NET Framework 1.1.4322. Does this mean I need a new version of Visual Studio .NET or Professional?
-
Aug 25th, 2005, 06:54 AM
#11
Frenzied Member
If you find my thread helpful, please remember to rate me 
-
Aug 25th, 2005, 10:51 AM
#12
Re: Send Text To Email
 Originally Posted by fdunford
I can import System.Web, but Mail is not there? Using Help-About I have Microsoft Development Environment V 7.1.3088 and .NET Framework 1.1.4322. Does this mean I need a new version of Visual Studio .NET or Professional?
no you need to add a reference to system.web.dll in the .net references.
Also NO, without the XP Pro CD, you will not be able to install IIS, you also will not be able to create asp.net applications if you wanted to, because you need IIS to make it work correctly in VS.
-
Aug 25th, 2005, 07:13 PM
#13
Member
Re: Send Text To Email
I just call Blat when I want to send e-mail messages from a vb app. You can pass it both messages and attachments, and you can pass usernames and passwords as well, so you can send mail through ESMTP enabled servers.
0000000100000010000000000000010100001001 reincarnated.
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
|