473,513 Members | 2,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending e-mail

I have an application where employees fill out forms and they are
e-mailed to the responsibility party once completed. I was planning on
using Microsoft Outlook (since everyone uses it for office e-mail) using
VBA. However, I was wondering if this is a mistake in performance
measures. It is a small app with under 10 users but I would like it to
be scalable and as efficient as possible. Are there better methods than
creating an outlook object in my program and manipulating it to function
as I want?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
3 1254
You can use System.Web.Mail

Its hardly 5-6 lines of code to send an email.

private void BtnSend_Click(object sender, System.EventArgs e)
{
MailMessage mail = new MailMessage();
mail.From = txtFrom.Text;
mail.To = "ab*@xyz.com";
mail.Subject = txtSubject.Text;
mail.Body = txtBody.Text ;
mail.BodyFormat = MailFormat.Html;
SmtpMail.Send(mail);
lblPostBack.Text = "Your Feedback has been sent to NetPointer";
}

----- Ivan Weiss wrote: -----

I have an application where employees fill out forms and they are
e-mailed to the responsibility party once completed. I was planning on
using Microsoft Outlook (since everyone uses it for office e-mail) using
VBA. However, I was wondering if this is a mistake in performance
measures. It is a small app with under 10 users but I would like it to
be scalable and as efficient as possible. Are there better methods than
creating an outlook object in my program and manipulating it to function
as I want?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #2
rr
Yes VB.net has a System.Web.Mail.MailMessage:

Try this and edit the server, and email portions.

hth
Robert

Sub sendPasswordReSetEmail()
'Send email to user to let them know their password is reset
Dim Message As New System.Web.Mail.MailMessage()
Dim SB As New System.Text.StringBuilder()
Dim S As String

'Recipient's name and e-mail address
Message.To = txtDisplayName.Text & "<" & txtLogonName.Text &
"@test.com>"
'Your name and e-mail address
Message.From = "Admin ad***@test.com"
'Message body

SB.Append("Your computer account password has been reset.\n")
SB.Append("Your password is " & txtPassword.Text)
SB.Append("Please change it to another password after you login")
SB.Append("thank you \n")
SB.Append("Admin \n")
Message.Body = SB.ToString.Replace("\n", vbCrLf)
Message.Subject = "YourComputer account"
'Your smtp server
System.Web.Mail.SmtpMail.SmtpServer = "smtp.server.com"

Try
System.Web.Mail.SmtpMail.Send(Message)
'MessageBox.Show("Your mail has been successfully sent!")
Catch ex As Exception
MessageBox.Show("The following problem occurred when attempting
to send your mail: " & ex.Message)
End Try

End Sub
"Ivan Weiss" <iv*****@optonline.net> wrote in message
news:Oh**************@TK2MSFTNGP12.phx.gbl...
I have an application where employees fill out forms and they are
e-mailed to the responsibility party once completed. I was planning on
using Microsoft Outlook (since everyone uses it for office e-mail) using
VBA. However, I was wondering if this is a mistake in performance
measures. It is a small app with under 10 users but I would like it to
be scalable and as efficient as possible. Are there better methods than
creating an outlook object in my program and manipulating it to function
as I want?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #3
* "rr" <rr**********@calpoly.edu> scripsit:
Yes VB.net has a System.Web.Mail.MailMessage:


Complete sample:

<http://msdn.microsoft.com/library/en-us/dnvssamp/html/vbcs_SendMail.asp>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

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

Similar topics

3
7027
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt....
1
14485
by: coder_1024 | last post by:
I'm trying to send a packet of binary data to a UDP server. If I send a text string, it works fine. If I attempt to send binary data, it sends a UDP packet with 0 bytes of data (just the...
3
4614
by: Robert A. van Ginkel | last post by:
Hello Fellow Developer, I use the System.Net.Sockets to send/receive data (no tcpclient/tcplistener), I made a receivethread in my wrapper, the receivethread loops/sleeps while waiting for data...
4
8189
by: yaron | last post by:
Hi, I have a problem when sending data over TCP socket from c# client to java server. the connection established ok, but i can't send data from c# client to java server. it's work ok with...
3
7696
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
3
11316
by: Sells, Fred | last post by:
I'm using MSW XP Pro with Python 2.4 to develop but production will be Linux with Python 2.3. (could upgrade to 2.4 if absolutely necessary) I can also switch to Linux for development if...
9
4882
by: Miro | last post by:
VB 2003 at the end of the code, this works great. bytCommand = Encoding.ASCII.GetBytes("testing hello send text") udpClient.Send(bytCommand, bytCommand.Length) and this recieves it Dim...
0
1850
by: remya1000 | last post by:
by using FTP i can send files to server using vb.net. if the file is big, then it will take some time to complete the sending process to server.or if we were sending 3-4 files to the server one by...
10
5046
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7099
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
7525
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...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3233
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
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
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
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.