Martin Xie - MSFT
Rudolph Scott wrote: |
The textboxes are on an Outlook 2007 new e-mail form. The default boxes are Subject, cc, Body, things like that. I additionally added some more textboxes to this form and named them (names like Caller, Surname,Building, etc, etc). Just like my code assigns the text value 'PhoneCall' to the subject box and displays the value in the subject box when the new mail message form loads, I want to assign a values to my custom boxes. For instance, I have a box called 'Caller' and I want to assign a text value to it and have it displayed in this box. I am doing this using Visual Basic in Visual Studio 2005.
Is it possible to use stringbuilder in this case Or do I need to use another method
| |
Hi Rudolph,
Please check the System.Net.Mail.MailMessage Class.
http://msdn2.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx
It represents an e-mail message that can be sent using the SmtpClient class.
The MailMessage class has these associated properties as below.
When an e-mail message is to be sent, basic properties will be specified, likewise, when you receive an e-mail message, you can directly retrieve relevant property value to your TextBox control.
SmtpClient can be used to send Email message.
PopClient can be used to retrieve Email messages.
Send Email sample.
Public Shared Sub CreateMessageWithAttachment(ByVal server As String)
' Specify the file to be attached and sent.
Dim file As String = "data.xls"
' Create a message and set up the recipients.
Dim message As MailMessage = New MailMessage("jane@contoso.com", "ben@contoso.com", "Quarterly data report.", "See the attached spreadsheet.")
'Create the file attachment for this e-mail message.
Dim data As Attachment = New Attachment(file, MediaTypeNames.Application.Octet)
' Add the file attachment to this e-mail message.
message.Attachments.Add(data)
'Send the message.
Dim client As SmtpClient = New SmtpClient(server)
' Add credentials if the SMTP server requires them.
client.Credentials = CredentialCache.DefaultNetworkCredentials
client.Send(message)
End Sub
References:
Send Email sample
POP3 Email Client (.NET 2.0)
Sending and Receiving Email
Regards,
Martin