473,699 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Email

JJ
Whats the most compatilbe way of sending an email ?- I need to consider that
the OS may be win 98/win NT/Win 2000/winXP.

I was constructing a mailto command, but the contents of the text file I am
using as the subject is too long and gets cut off. I therefore need a method
that doesn't use the limitations of mailto (in terms of the length of the
subject text) or allows me to add the text file as an attachment.

I am using VB 2003. I don't mind assuming that the using has outlook if that
is the only way.

TIA
Jan 27 '06 #1
4 2264
JJ wrote:
Whats the most compatilbe way of sending an email ?- I need to consider that
the OS may be win 98/win NT/Win 2000/winXP.

I was constructing a mailto command, but the contents of the text file I am
using as the subject is too long and gets cut off. I therefore need a method
that doesn't use the limitations of mailto (in terms of the length of the
subject text) or allows me to add the text file as an attachment.

I am using VB 2003. I don't mind assuming that the using has outlook if that
is the only way.

TIA


..net has a built in mail thing. Look at the system.web.mail namespace.
--
Rinze van Huizen
C-Services Holland b.v
Jan 30 '06 #2
JJ
Rinze - thanks for replying.

As far as I can see the system.web.mail namespace will only work if you
specify an SMTP server or are running on windows 2000. I have no access to
an smtp server for the app and don't know the one the end user will have
access to. [Will it use the users default SMTP server if none is specified
on a non windows 2000 system?] I need to open a fresh email message using
their default email client (sorry should have been more specific) before
sending. The system.web.mail namespace seems to send the mail 'silently' if
I understand it correctly.

I only need to send textual information - but its more than a mailto:
command can cope with.

Please correct me if my understandung of the system.web.mail namespace is
incorrect.
"C-Services Holland b.v." <cs*@REMOVEcsh4 u.nl> wrote in message
news:M9******** *************** *******@zeeland net.nl...
JJ wrote:
Whats the most compatilbe way of sending an email ?- I need to consider
that the OS may be win 98/win NT/Win 2000/winXP.

I was constructing a mailto command, but the contents of the text file I
am using as the subject is too long and gets cut off. I therefore need a
method that doesn't use the limitations of mailto (in terms of the length
of the subject text) or allows me to add the text file as an attachment.

I am using VB 2003. I don't mind assuming that the using has outlook if
that is the only way.

TIA


.net has a built in mail thing. Look at the system.web.mail namespace.
--
Rinze van Huizen
C-Services Holland b.v

Jan 30 '06 #3
JJ wrote:
Rinze - thanks for replying.

As far as I can see the system.web.mail namespace will only work if you
specify an SMTP server or are running on windows 2000. I have no access to
an smtp server for the app and don't know the one the end user will have
access to. [Will it use the users default SMTP server if none is specified
on a non windows 2000 system?] I need to open a fresh email message using
their default email client (sorry should have been more specific) before
sending. The system.web.mail namespace seems to send the mail 'silently' if
I understand it correctly.

I only need to send textual information - but its more than a mailto:
command can cope with.

Please correct me if my understandung of the system.web.mail namespace is
incorrect.
"C-Services Holland b.v." <cs*@REMOVEcsh4 u.nl> wrote in message


I understand your problem. In essence I'm trying to do the same and ran
into the mailto limitations. AFAIK it will not use the configured SMTP
server, for that it would have to know where to find those settings of
various mailclients. So I'm resorting to have them enter the SMTP
settings in a configuration screen. It's a bit of a hassle (for the
user) but so far I don't have any choice.

--
Rinze van Huizen
C-Services Holland b.v
Jan 31 '06 #4
JJ
Hi Rinze.

That seems to be the only solution. I think I'll do the same - only also
give the option of attempting to open an outlook mail message. The send mail
function is important to the whole function of the program so I have to make
sure they can do it some way.

Below is the Outlook code if its of any use to you. If Outlook is installed
it'll create an instance of it and construct a mail message. It'll also
clean up after itself by closing Outlook if it's instance was created by the
app.

Thanks for your help.

----

Global vars:
-------------
Private myOutlookApp As Outlook.Applica tion 'for outlook email
Private MyOutlookAppKil lMe As Boolean = True 'for outlook email
E-mail Function:
----------------
Private Function OpenEmail(ByVal EmailAddress As String, Optional ByVal
Subject As String = "", Optional ByVal Body As String = "")
'lauches a new intance of Outlook if it isn't running already, and
constructs and email message. The form closing routine closes Outlook if
this program
'launched it (i.e. it wasn't running already). If no outlook instance is
present or created, then outlook isn't installed and the relevent menu
options
' are therefore disabled.

Try
myOutlookApp = CType(GetObject (, "Outlook.Applic ation"),
Outlook.Applica tion)
MyOutlookAppKil lMe = False
Catch ex As Exception
'if not then launch it
If myOutlookApp Is Nothing Then
myOutlookApp = New Outlook.Applica tion
MyOutlookAppKil lMe = True
End If
End Try
'if myOutlookApp is nothing then Outlook isn't installed
If myOutlookApp Is Nothing Then
MessageBox.Show ("Outlook is required for this function. .", "Outlook Not
Available", MessageBoxButto ns.OK, MessageBoxIcon. Exclamation)
ToolBar1.Button s.Item(17).Enab led = False
mnuEmail.Enable d = False
Exit Function
Else
Try
Dim thisEmail As Outlook.MailIte m
Me.Cursor = Cursors.WaitCur sor
thisEmail =
DirectCast(myOu tlookApp.Create Item(Outlook.Ol ItemType.olMail Item),
Outlook.MailIte m)
With thisEmail
.To = EmailAddress.Tr im()
.Subject = Subject.Trim()
.BodyFormat = Outlook.OlBodyF ormat.olFormatP lain
.Body = Bodystring
.Display()
End With
Me.Cursor = Cursors.Default
Catch ex As Exception
MessageBox.Show ("Outlook encountered a problem when trying to
construct the email. ", "Outlook Error", MessageBoxButto ns.OK,
MessageBoxIcon. Exclamation)
End Try

End If
End Function


Then on closing the app, add the code:
--------------------------------------

'Outlook checks:
If MyOutlookAppKil lMe = True Then 'Check if this app had started Outlook
If Not myOutlookApp Is Nothing Then
myOutlookApp.Qu it() 'if outlook is running then close it
myOutlookApp = Nothing
End If
End If

[I can't take credit for all this code - it was based on someone elses, but
I can't for the life of me find who it was.]
"C-Services Holland b.v." <cs*@REMOVEcsh4 u.nl> wrote in message
news:sd******** ************@ze elandnet.nl...
JJ wrote:
Rinze - thanks for replying.

As far as I can see the system.web.mail namespace will only work if you
specify an SMTP server or are running on windows 2000. I have no access
to an smtp server for the app and don't know the one the end user will
have access to. [Will it use the users default SMTP server if none is
specified on a non windows 2000 system?] I need to open a fresh email
message using their default email client (sorry should have been more
specific) before sending. The system.web.mail namespace seems to send the
mail 'silently' if I understand it correctly.

I only need to send textual information - but its more than a mailto:
command can cope with.

Please correct me if my understandung of the system.web.mail namespace is
incorrect.
"C-Services Holland b.v." <cs*@REMOVEcsh4 u.nl> wrote in message


I understand your problem. In essence I'm trying to do the same and ran
into the mailto limitations. AFAIK it will not use the configured SMTP
server, for that it would have to know where to find those settings of
various mailclients. So I'm resorting to have them enter the SMTP settings
in a configuration screen. It's a bit of a hassle (for the user) but so
far I don't have any choice.

--
Rinze van Huizen
C-Services Holland b.v

Jan 31 '06 #5

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

Similar topics

12
8786
by: Chuck Anderson | last post by:
Can anyone point me in the right direction? I want to use Php to automate confirmation of someone joining an email list by them replying to an email (so they don't have to have a browser?). I will probably use a hyperlink with a unique ID, but I also want to know how to go about reading from a mailbox with Php so I can use an email reply method, too. I'm having trouble finding any kind of tutorial. From the bit of searching I've done,...
4
3016
by: dmiller23462 | last post by:
So here's my problem.....I need to set up different email distributions based on which option in the following Select form has been chosen....For instance if "Putaway" is chosen it needs to email User1@here.whatever and User4@here.whatever but if "Loaded" is chosen it needs to email User2@here.whatever and User3@here.whatever, etc, etc... I'm aware that the only thing that really needs to change is the "Mail.AddAddress" line (at least...
88
12505
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
2
2219
by: BSG-SMTP-Gateway | last post by:
The following message sent by this account has violated system policy: Connection From: 64.253.55.90 From: python-list@python.org To: terriss@birdsall.com, q4dzsAEAAAAA@birdsall.com, zSbxT7FSCIAEAAAAA@birdsall.com, rQEAAAAA@birdsall.com, 20a.9ea7bfe.306372db@birdsall.com, Gslotnick@birdsall.com, chrisbaker@birdsall.com, mshawver@birdsall.com, SJCSmile@birdsall.com, Pugsleydmd@birdsall.com, FredBMaier@birdsall.com, dbosco6896@birdsall.com,...
26
2762
by: libsfan01 | last post by:
Hi all! Can anyone show me how to check and email field on a form for the existence of these two characters. Kind regards Marc
0
8617
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9174
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8884
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7751
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4376
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
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 we have to send another system
2
2347
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.