473,386 Members | 1,748 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,386 software developers and data experts.

Creating an email and formatting

Hi Everyone,

I am having a problem with sending an email from a VB.NET application. I can
send an email automatically from my application (without seeing it) but I
want to load the data into my email program so that the email will be logged
in my sent items folder for future reference.

I am using the following code
strEmail = "mailto:" & strTo & "?subject=" & strSubject & "&body=" & strbody
System.Diagnostics.Process.Start(strEmail)
This all works fine and dandy but the email is not formatted properly. I
want to preview a formatted email.

How does one do this?
Can I get a handle to the email program process and manipulate it?

Thanks

Calvin X
Nov 20 '05 #1
1 1059
Hi Calvin,

What formatting issues do you have?

LOL. I've only just (two hours or so) posted this code in another thread -
it may be useful to you. It adds encoding so that all characters will get
through.

Regards,
Fergus

<code>
'A reference to System.Web may be necessary
'in the Project for this Import to work.
Imports System.Web.HttpUtility

Public Sub StartDefaultMail (sTo As String, _
Optional sSubject As String = "", _
Optional sMessage As String = "")
Try
sTo = UrlEncode (sTo)
sSubject = UrlEncode (sSubject)
sMessage = UrlEncode (sMessage)
Process.Start ("mailto:" & sTo & "?subject=" _
& sSubject & "&body=" & sMessage)

Catch e As Exception
MsgBox ("Couldn't start default email application" _
& vbCrLf & e.Message)
'or
Throw New Exception ("Couldn't start default email app", e)
End Try
End Sub
</code>

Nov 20 '05 #2

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

Similar topics

5
by: Guy Incognito | last post by:
Hello, I've written an asp.net application that creates Excel documents. It works by creating an excel document in XML format. But I wonder if I'm reinventing the wheel. I know that there are...
3
by: Tom Vukovich | last post by:
and returning the xml to the requesting web page, how do you insert the XML declaration? ds.EnforceConstraints = False Response.ContentType = "text/xml" ds.WriteXml(Response.OutputStream,...
2
by: John Bowman | last post by:
Hello, I need to create some well formed XML text live in memory. What I really want is to use the XmlTextWriter object applied to some location in memory (Stream or something?), because it does...
4
by: Sean Shanny | last post by:
To all, Running into an out of memory error on our data warehouse server. This occurs only with our data from the 'September' section of a large fact table. The exact same query running over...
5
by: Peter Chant | last post by:
Any thoughts in the newsgroup? Over Christmas I produced, using PHP and MySQL, a database and front end to record my familys family tree with a short biography and linked photos and locations if...
5
by: darnnews | last post by:
Hi, I have been creating a database to keep track of press clippings, but I have hit a couple stumbling blocks. Any help is much appreciate. 1) Seeing if my query is done I have the...
8
by: Swans, What Swans? | last post by:
In one of my tables, in addition to a text field that is a Description field, there are two fields for color formatting the data in reports. They are Longs and hold the foreground and background...
33
by: STILL LEARNING | last post by:
I'm not sure if this can even be done, but what prompts the question is my desire to be able to create an "Uber Link" script/code of some sort, such that even if the html page contains nothing but...
3
Kelicula
by: Kelicula | last post by:
This is NOT a complete OO perl tutorial However I thought it could be beneficial to explain some of the basic concepts, and allow some users to simplify the software design process. I have...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
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...

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.