473,237 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

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 1032
"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
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
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
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
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
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
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.