Solved

Email Results...

Posted on 1998-10-23
16
145 Views
Last Modified: 2013-11-13
How can i email the text of a bunch of txts on two forms to a email address when they click on a button?
0
Comment
Question by:cdc_sickle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
16 Comments
 
LVL 7

Expert Comment

by:kamall
ID: 1441354
You can send e-mail by using the Winsock control.
If you need help with the code, I can send you a complete project if you comment me your e-mail address.
Regards
0
 

Author Comment

by:cdc_sickle
ID: 1441355
the_ray_family@msn.com
0
 

Author Comment

by:cdc_sickle
ID: 1441356
the_ray_family@msn.com
0
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!

 

Author Comment

by:cdc_sickle
ID: 1441357
You havent sent the email yet so im gonig to leave it open for somone else unless you send the email
0
 

Author Comment

by:cdc_sickle
ID: 1441358
Will someone please answer my question? I will raise points if i have to!
0
 
LVL 9

Expert Comment

by:david_levine
ID: 1441359
By email, do you mean an internal corporate email system like Microsoft Exchange or over the Internet?


0
 

Author Comment

by:cdc_sickle
ID: 1441360
I dont care, as long as the information gets to my email address!
0
 
LVL 2

Expert Comment

by:lmorris
ID: 1441361
Option Explicit

Private Sub Command1_Click()
    MAPISession1.DownLoadMail = False
    MAPISession1.SignOn
   
    With MAPIMessages1
        .SessionID = MAPISession1.SessionID
        .Compose
        .RecipAddress = "the_ray_family@msn.com"
        .MsgSubject = "Sending textbox text via email."
        .MsgNoteText = "Textbox1=" & Text1.Text & vbCrLf
        .MsgNoteText = .MsgNoteText & "Textbox2=" & Text2.Text & vbCrLf & vbCrLf
        .MsgNoteText = .MsgNoteText & "If you're using a MAPI compliant mail system like Outlook, Outlook express, Exchange, the InBox, etc., you can send email via the internet the same way you would send an internal message. The MAPI controls can be quite handy."
       
        .Send False
    End With
   
    MAPISession1.SignOff
End Sub

Private Sub Form_Load()
    Text1.Text = "This is the text from textbox 1."
    Text2.Text = "This is the text from textbox 2."
End Sub

0
 

Author Comment

by:cdc_sickle
ID: 1441362
i get an error at the first part
MAPISession1
anser again and if it worx ill raise points and give you a a

0
 

Expert Comment

by:hookie
ID: 1441363
Hi cdc_sickle

The above answer by imorris will work. The reason why its not working on your system is that you don't seem to have the MAPI controls on your form. To do this, go to the PROJECTS menu, select COMPONENTS and scroll down the list till you get to MICROSOFT MAPI CONTROL. Tick this and go back to your form. In your TOOLBOX you should have two new controls, MapiSession and MapiMessages. Add both these controls to your form and play around with the above code again. It should work.
If all fails, write back again and I will step you through it with my own sample code, for MAPI control and OUTLOOK referencing.

Cheers...

Hookie.....
0
 

Author Comment

by:cdc_sickle
ID: 1441364
Is it necesary to go through all the inbox settings and go into inbox to actually send the mail? Also, theres an error at .Send False
0
 

Author Comment

by:cdc_sickle
ID: 1441365
Everybody using this program will be using aol
0
 
LVL 7

Accepted Solution

by:
kamall earned 50 total points
ID: 1441366
I've just sent you the project.
It has been tested and works perfectly.
Sorry for the delay.
Regards
0
 
LVL 7

Expert Comment

by:kamall
ID: 1441367
cdc_sickle,
In the project I sent you, you can delete the two text boxes where you enter your name and your e-mail address (of the recipient who is you) and put them in the code.
0
 

Author Comment

by:cdc_sickle
ID: 1441368
Ok, it worx, but when i put it in another program it gives me this error:
Run-time error 140020
Ivalid operation at current state

Winsock1.LocalPort = 0
0
 
LVL 7

Expert Comment

by:kamall
ID: 1441369
Do you have another Winsock control in the other project?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
t-sql sp_addlinkedserver possible risks 3 121
Need Nag Screen for Reboot if system up time is over 14 days 12 97
Problem to refer to value 8 101
convert Systemjs to Webpack 3 126
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

739 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