473,498 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending Emails from Code


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.

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
Jan 5 '06 #1
4 1038
"Helen Trim" <He*******@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/>

Jan 5 '06 #2
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" <He*******@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/>

Jan 5 '06 #3
You need to add a reference to system.web (even from a Windows application).

See http://www.systemwebmail.com/

--
HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Concept S2i inc. (www.s2i.com)
http://emoreau.s2i.com/

"Helen Trim" <He*******@discussions.microsoft.com> wrote in message
news:6B**********************************@microsof t.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" <He*******@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/>

Jan 5 '06 #4
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

Jan 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2873
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and confirmed that these emails work in yahoo.com's...
10
4941
by: Stuart Mueller | last post by:
I have an exchange server, that I sometimes use to perform mail shots to clients on our database, these can be upwards of 1000 at a time. As we don't want different clients to see who we are...
5
23768
by: Kun | last post by:
i have the following code: ---------------------------------- import smtplib from email.MIMEText import MIMEText fp = open('confirmation.txt', 'rb') msg = MIMEText(fp.read()) From =...
5
2416
by: Jai | last post by:
Hi, I am in a problem of sending mass emails(newsletter) to my website members. Actually my problem is this: I want to send newsletter to my website members. But I had given a facility for...
2
3726
by: lstanikmas | last post by:
Hi, I'm validating a form with this ASP but receiving some blank email responses; does anyone see anything wrong with it?: function isFormVarExcluded(thisForm, strToCheck) { var strExcludeVars...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.