|
-
Oct 3rd, 2003, 01:38 PM
#1
Thread Starter
Addicted Member
Sending outlook email from vb.net --> RESOLVED
anybody have already or know how to send an email from my vb.net application? The program that we use to send and recive emails is Outlook.
Thank you,
Guilherme Costa
Last edited by gccosta; Oct 3rd, 2003 at 02:49 PM.
-
Oct 3rd, 2003, 02:14 PM
#2
Sleep mode
-
Oct 3rd, 2003, 02:48 PM
#3
PowerPoster
Or, use the system.web.mail namespace.
-
Oct 3rd, 2003, 03:17 PM
#4
Sleep mode
Originally posted by hellswraith
Or, use the system.web.mail namespace.
This gonna be messy unless he has a running relay's address server or launching his own SMTP Server .
-
Oct 4th, 2003, 06:24 AM
#5
Sleep mode
Originally posted by Pirate
This gonna be messy unless he has a running relay's address server or launching his own SMTP Server .
or online SMTP that accepts your requests to deliever the messages to destination .
-
Oct 4th, 2003, 06:57 PM
#6
PowerPoster
As long as your from address has a valid account with the smtp server you are sending it from, it has no problems. At least that is my experience. I was able to make a quick and dirty example for someone that was a windows forms application and I sent it through my web hosting mail server with no problems as long as I sent it from a valid email address. I wasn't able to spoof the from address as somone elses (this is a good thing).
I will try to post an example later tonight, really simple. The added benefit is you can do it all in code by setting the text of the subject, the message body, the to and from address, etc. This makes it transparent to the user which in some cases is the best way to go.
-
Oct 5th, 2003, 12:45 PM
#7
Sleep mode
hellswraith , could you try this example and see if it works with hotmail accounts . Been trying to no avail . I even posted this in C# section and it worked with some of the guys there .
http://www.c-sharpcorner.com/Interne...notifierlc.asp
thanks .
-
Oct 5th, 2003, 02:12 PM
#8
PowerPoster
I don't have a hotmail account to test it on.
To send a mail message from a windows forms account, do something like this.
VB Code:
'Create the mail message object and set its properties.
Dim theMail As New System.Web.Mail.MailMessage
theMail.Body = "Whatever text you want."
theMail.Subject = "My subject"
'Set up the SMTP server to use to send the message.
System.Web.Mail.SmtpMail.SmtpServer = "mail.yourmailserverdomain.com"
'Send the mail.
System.Web.Mail.SmtpMail.Send(theMail)
-
Feb 11th, 2004, 07:23 AM
#9
Frenzied Member
this thread is a bit older but I have a question about the namespace.
when I put the system.web.mail in the imports section, my intelli-sence doesn't recognize the mail part. do I need to add a reference to it?
-
Feb 11th, 2004, 09:37 AM
#10
Hyperactive Member
It has been a while since I did this but I think you need to add System.Web.dll (from the .Net references) to your project to send email from a Windows form.
-
Feb 11th, 2004, 11:30 AM
#11
Frenzied Member
thanks!! i put both that one and the web.mail.services in just to make sure.
does have a referenced dll in the app make it bigger and if you don't need it, does it slow it down?
-
Feb 11th, 2004, 11:31 AM
#12
Frenzied Member
on another note, how do you get vb to launch the default mail client? I don't want to use shell() cause the path may not always be correct.
edit: I found a thread on this subject. disregard
Last edited by Andy; Feb 11th, 2004 at 11:41 AM.
-
Feb 11th, 2004, 11:58 AM
#13
Member
I try this code works greater
Can some one help with adding Attachment?
I try this code but it gives me and error "Specified cast is not valid"
Attach = OpenFileDialog1.FileName
theMail.Attachments.Add(Attach)
Please help
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
|