Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Sending Email from Visual Basic.

Posted on 2003-03-18
7
Medium Priority
?
196 Views
Last Modified: 2013-12-04
Visual Basic is very powerful! All I want to know is some expert advice on email sending. When sending email you can use the mailto command but there are some limitation in the body. You can only send a certain amount of caracters. Using Outlook's Com Object is also limited in the sence that you can only use Outlook. If the user only has Outlook Express or even navigator, then you sit with your finger in your ear! What is the best possible way to do this? How can we as developers send email so that the default installed email client will be used? I have a feeling that it is going to be the mailto command. Why this is limited for me is that I need to be able to email document. Text that users insert into a database must be emailed at will. So obviously the documents will contain more that 500 caracters. Please help!!!

Abrian
0
Comment
Question by:Abrian
  • 3
  • 2
6 Comments
 
LVL 4

Accepted Solution

by:
iozturk earned 1200 total points
ID: 8159561
Try using the code someting like. First add CDONTS lib. from references.

Dim objmail As cdonts.NewMail
   Dim email As String
   Dim file_name As String
   Dim fso As Scripting.FileSystemObject
   Dim objability As Helpdesk.Ability
   Dim uploadpath
   
   
   On Error GoTo ErrorX
     
   uploadpath = fUploadPath
   Set objmail = New cdonts.NewMail
   isim = objability.fFindAdi(kulkodu) & " " & objability.fFindSoyadi(kulkodu)
   objmail.From = objability.fFindEmail(kulkodu)
   objmail.To = "a@b.com"
   objmail.Subject = "subject"
   objmail.Body = "message"
   
   
   
       objmail.Send
    End If
   
    Set objmail = Nothing
    Set objability = Nothing
0
 
LVL 4

Expert Comment

by:iozturk
ID: 8159573
There are some typo


Dim objmail As cdonts.NewMail
Dim email As String
Dim uploadpath
 

 
  Set objmail = New cdonts.NewMail

  objmail.From = objability.fFindEmail(kulkodu)
  objmail.To = "a@b.com"
  objmail.Subject = "subject"
  objmail.Body = "message"
 
 
   
   objmail.Send

0
 
LVL 4

Expert Comment

by:iozturk
ID: 8159581

Again typo

pls change

 objmail.From = objability.fFindEmail(kulkodu)
to
 objmail.From = "youremail"
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 800 total points
ID: 8161008
0
 

Expert Comment

by:CleanupPing
ID: 9447040
Abrian:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 9447086
split points between emoreau and iozturk
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Simple Linear Regression
Introduction to Processes

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question