I know how to create an email message with the
dim mail as process
mail.start(mailto:..........)
but is there a way to create a mail message and send it without showing it to the user?
If so. How?
Thanks
Printable View
I know how to create an email message with the
dim mail as process
mail.start(mailto:..........)
but is there a way to create a mail message and send it without showing it to the user?
If so. How?
Thanks
Use system.web.mail class.
As VB app it's ganna be a way frustrated . You need IIS running or any COM+ that acts as relay server to be able to send msgs . Someone told me he can does this with Socket yet he never replied me . If that's for ASP , it's easier . Search here or google it . A lot of examples around .
I dont think so, if you can use a smtp mail server (the one that you actually use when using outlook or such) then you can use that without the need for IIS.Quote:
Originally posted by Pirate
You need IIS running or any COM+ that acts as relay server.
Sorry it's my fault . Still confusing IIS with SMTP . Pretty easy but I've just got back from work . :o ..........:D .
Pirate:
I have searched but didn´t find any examples ... Maybe you can do a search and help me?
Lunatic3 that works for a VB.net project? Do I have to create a own mail server or can I use my mailto line?
Or is it any other way that I can use my mailto line?
The mail is opened and created in MS Outlook but it´s the last thing. It won´t send, even if I got the adress,subject ... etc etc...
So if it´s a command for the send button or something?
Thanks for the help
I am a little confused about your question. Do you want to know how to send an email using outlook and such or you want to write a VB .NET application to do that?
In order to send mail using outlook (or outlook express or any other mail client) you need a mail server (that actually does the task of sending your email). In most cases the ISP's provide a mail server for you that you can set in the outlook express and use it, however if you are running IIS on Windows XP, 2000, or 2003 then your mail server can be yourself.
But if you want to send emails using VB .NET then one way will be using that System.Web.Mail class.
Plus SMTP server . Generally , it comes as OCX or DLL .Quote:
Originally posted by Lunatic3
But if you want to send emails using VB .NET then one way will be using that System.Web.Mail class.
That's in case you didn't provide your reall SMTP Server address. If you have it , you can add it to your mail settings .
Ok. Going to try and explain.
I got a VB.net program that checks dates in a database.
If that date gets to old I want an mail to send.
But I don´t want it to be visible to the user.
At the moment I´m using the mailto line. but it opens a email message and the user have to push the send button. I want the program to send it without the need of pushing the send button.
I need a mail server for that? Or can it be done on an easier way?
I have searched for the web mail class but haven´t found anything. Maybe I´m searching on the wrong place/words
Tried to work with smtp.
This is what I got atm.
Dim mailinfo As New System.Web.Mail.MailMessage()
With mailinfo
.From = "you@urplace"
.To = "myself$my.house"
.Subject = "My SMTP Test"
.Body = "My New Message"
End With
SmtpMail.SmtpServer = "MyServerName"
SmtpMail.Send(mailinfo)
But the thing is that system.web.mail.mailmessage aint defined.
I try to import system.web.mail at the top but it says it can´t be found.
Anything missed in the install or something else?
Thanks for answers
Did you reference System.Web.dll to your proj ?
Probably not.
When I refere to a dll it´s the same as the imports? like
import system.web.dll
?
Hi All,
I used "System.Web.Mail" to send mails from my application. When i tried to run the code i got the following error i don't have permissions for the assembly to do it, give appropriate permissions using Microsoft .Net security policy administration tool. Where I can i find this tool in my machine and how to solve the same. Treat this as urgent. Thanks in advance.
Not really . First you have to reference the dll . Then use 'Imports' keyword to import (use) the functions or classes existed in that dll . 'Imports' is just a way to organize your code and shorten the declaration of objs in .NET .Quote:
Originally posted by Iceman5
Probably not.
When I refere to a dll it´s the same as the imports? like
import system.web.dll
?
Found the import of dll etc.
But got a problem with cdo. Still checking for a solve to it.
Searching for the file so I can include it.
Haven´t got time to check it that much yet though.
Thanks for the help all.
Hi Pirate,
Thanks a lot ,I tried by importing System.Web.Mail namespace It worked.
How to authentication username and password when sending SMTP mails?.
Hi Pirate,
Thanks a lot ,I tried by importing System.Web.Mail namespace It worked.
How to authenticate username and password when sending SMTP mails?.
I've not seen this before , see this example :http://www.codeproject.com/csharp/sendmailcsharp.asp