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

Sending e-mail is it so simple ?

would like to send messages from my vb application with the user default mail software. That's to say preparing content, attachement and let user selecting the "to" option with it's own friends list. I had a close look to this community and web pages but I'm not really sure to find what I wanted
I do not want to use outlook, as perhaps it's not the user mail software, I want to use default user software, not knowing it
I do not want to use system.web.mail as I do not want to send directly the mail and don't know the smtp server. I want the user to select the destination like with a normal mail
MAPI does want I want but when I install the soft on another pc, I get a "no license for this class" message which seems to be a known problem and has no real good solution (but this would be the solution closest to my needs !)
I didn't spent time to cdo as I spent already much time and would prefer to know before if it the good way to look at
and finally, I'm wondering also about sendto objec
So... what will be your ideas for something which seemed to me simple at the beginning...
Nov 20 '05 #1
5 1145
Hi,

Take a look at indy.
http://www.indyproject.org/Indy.html

Here a vb.net version of the send mail demo.
http://www.onteorasoftware.com/downl...dysendmail.zip

Ken
------------------
"Olivier/Noetika" <an*******@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
would like to send messages from my vb application with the user default
mail software. That's to say preparing content, attachement and let user
selecting the "to" option with it's own friends list. I had a close look
to this community and web pages but I'm not really sure to find what I
wanted.
I do not want to use outlook, as perhaps it's not the user mail software,
I want to use default user software, not knowing it.
I do not want to use system.web.mail as I do not want to send directly the
mail and don't know the smtp server. I want the user to select the
destination like with a normal mail.
MAPI does want I want but when I install the soft on another pc, I get a
"no license for this class" message which seems to be a known problem and
has no real good solution (but this would be the solution closest to my
needs !).
I didn't spent time to cdo as I spent already much time and would prefer
to know before if it the good way to look at !
and finally, I'm wondering also about sendto object
So... what will be your ideas for something which seemed to me simple at
the beginning...

Nov 20 '05 #2
Thanks for the rply. I just wanted to include a few lines to send an email, like it was possible with VB6& Mapi and the 3,5 Meg of indysocket.dll seems a bit heavy for that. Furthermore, what seems to me the more interesting is to use the default mail client of the user, in order to let him select the mail adress by in its own list

I would prefer to find how application like Word does with it's file/"send to" as attachment command to open a mail with a joined file.
Nov 20 '05 #3

You can try this, this is the easiest method to use the standare email
client, however attachments should be attached by the client by hand because
for that is not method to do it programly.

I hope this helps?

Cor

\\\Question is of sSubject and sMessage has to be with UrlEncode, at me it
goes wrong with and for Herfried it goes wrong without so that should me
tried.

'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 = sSubject
sMessage = 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
///
Nov 20 '05 #4
* "Cor Ligthert" <no**********@planet.nl> scripsit:
Public Sub StartDefaultMail (sTo As String, _
Optional sSubject As String = "", _
Optional sMessage As String = "")
Try
sTo = UrlEncode (sTo)
sSubject = sSubject
sMessage = sMessage
Process.Start ("mailto:" & sTo & "?subject=" _
& sSubject & "&body=" & sMessage)


I still think that 'sSubject' and 'sMessage' should be encoded too.

;-)

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #5
Yes, thanks, it's an easy method but as you pointed at, it's not possible to attach a file. And the line.length seems to be limited to about 2000 chars. I still wonder how soft like word does (send as attachment is exactly what I would like to reproduce).
Nov 20 '05 #6

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

Similar topics

3
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
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...
1
by: Tim Black | last post by:
My application requires sending a large piece (~2MB) of data to several devices on a network via TCP sockets. I have experimented with different methods for doing this and this has raised some...
2
by: Joe | last post by:
Hi, I am sending an email from an asp page. Besides sending an email to sender, I am sending myself a BCC also. Out of 100 emails sent, about 5 recipients received a blank email (no text in...
3
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...
2
by: anonymous | last post by:
Hi, I'am sending an xml string to a web service(which is written in c#) using the microsoft web services behavior. When I check this string from the web service I observed that some of the...
3
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
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...
0
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.