|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Sending Emails from Codeeach time it sends an email, a message appears warning the user and they have to wait 5 seconds for the Yes button to appear before they can click it. This is a bit annoying. Is there an Outlook setting that will stop this message appearing? Or can I edit the code? It is written in VB .Net: Dim Email As New OutlookClass Dim Message As Outlook.MailItem Message = Email.OutlookApp.CreateItem(0) Message.To = "Email address" Message.Subject = "TCI Card " Message.Body = "Text" Message.Send() Thanks, Helen -- Helen "Helen Trim" <HelenT***@discussions.microsoft.com> schrieb: I am curious why you are not using 'System.Web.Mail' (.NET 1.0/1.1) or > I have a program that sends emails automatically. It works correctly, but > each time it sends an email, a message appears warning the user and they > have > to wait 5 seconds for the Yes button to appear before they can click it. > This is a bit annoying. 'System.Net.Mail' (.NET 2.0), which won't require Outlook to be installed. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Good point, Herfried.
It is a Windows application and I haven't found out yet how to send email without using Outlook. I'll keep looking but if you have any tips, I'd be very grateful. Thanks Helen -- Show quoteHide quoteHelen "Herfried K. Wagner [MVP]" wrote: > "Helen Trim" <HelenT***@discussions.microsoft.com> schrieb: > > I have a program that sends emails automatically. It works correctly, but > > each time it sends an email, a message appears warning the user and they > > have > > to wait 5 seconds for the Yes button to appear before they can click it. > > This is a bit annoying. > > I am curious why you are not using 'System.Web.Mail' (.NET 1.0/1.1) or > 'System.Net.Mail' (.NET 2.0), which won't require Outlook to be installed. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> > > You need to add a reference to system.web (even from a Windows application).
See http://www.systemwebmail.com/ -- Show quoteHide quoteHTH Éric Moreau, MCSD, Visual Developer - Visual Basic MVP Conseiller Principal / Senior Consultant Concept S2i inc. (www.s2i.com) http://emoreau.s2i.com/ "Helen Trim" <HelenT***@discussions.microsoft.com> wrote in message news:6B2872C6-99EC-4FFC-BBCE-A2DE261710E6@microsoft.com... > Good point, Herfried. > > It is a Windows application and I haven't found out yet how to send email > without using Outlook. > > I'll keep looking but if you have any tips, I'd be very grateful. > > Thanks > Helen > -- > Helen > > > "Herfried K. Wagner [MVP]" wrote: > >> "Helen Trim" <HelenT***@discussions.microsoft.com> schrieb: >> > I have a program that sends emails automatically. It works correctly, >> > but >> > each time it sends an email, a message appears warning the user and >> > they >> > have >> > to wait 5 seconds for the Yes button to appear before they can click >> > it. >> > This is a bit annoying. >> >> I am curious why you are not using 'System.Web.Mail' (.NET 1.0/1.1) or >> 'System.Net.Mail' (.NET 2.0), which won't require Outlook to be >> installed. >> >> -- >> M S Herfried K. Wagner >> M V P <URL:http://dotnet.mvps.org/> >> V B <URL:http://classicvb.org/petition/> >> >> Add the reference as Heinfred pointed out. Here's a simple, but working
function. Private Function SendMail() As Boolean 'Set up SMTP mail parameters Dim Email As New MailMessage Email.To = EmailTo 'String variable Email.From = EmailFrom 'String variable Email.Subject = EmailSubject 'String variable Email.Body = EmailBody 'String variable SmtpMail.SmtpServer = (SMTPServer) 'Name of your SMTP server 'Send the mail SmtpMail.Send(Email) End Function
Debugging in VS2005 - why is some code shaded grey?
alter built-in ContextMenu Microsoft doesn't want you to use VB .Net SqlConnection component in VB.2005 For each ..... next Question Setup and Deployment and Microsoft Jet OLE DB Provider Solution rebuilding issues VS2005 Address Matching System WIA.ImageFile to System.Drawing.Image its a pain! |
|||||||||||||||||||||||