?
Solved

Sending email without hardcoding email server information. How?

Posted on 2006-05-30
9
Medium Priority
?
267 Views
Last Modified: 2010-04-23
Hello Experts,

I've found some posts on EE regarding how to send emails however all of them require to my knowledge the hardcoding of the email server information.

Basic Info:

At work, we have around 2700 workstations and each employee already has their own NT login which just happens to be part of their email address too e.g. johndoe@company.com.

I was wondering if there is a way to create and app that consists of lets say... Button1 & Text1. Whatever txt is found within this box gets sent to a hard coded email address once Button1 is pressed.

Question:

How to make the code behind this button send emails with currently logged on user's outlook profile including all email server info etc.

Thanks for any help : -)
0
Comment
Question by:donniedarko801
  • 3
  • 3
  • 2
8 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16794875
1) Are you asking how to send email with Outlook automation?

2) What version of Outlook are you using?

3) Does everyone have the same version?

Bob
0
 
LVL 6

Accepted Solution

by:
ctm5 earned 2000 total points
ID: 16795077
I found a down and dirty way to do what you want:

        Dim sendto As String = MyHardCodedEmailAddress
        Dim strHeader As String = Textbox1.Text
        Dim strTarget As String = "mailto:" & sendto & "?body=" & strHeader
       
        System.Diagnostics.Process.Start(strTarget)

My app is used by all sorts of people on all sorts of systems and so far (crossyafingas) no problems.

ctm5
0
 
LVL 1

Author Comment

by:donniedarko801
ID: 16795390
Outlook 2000. All of them yes.
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 96

Expert Comment

by:Bob Learned
ID: 16798264
Are you going to send attachments?  If so, you can't use the mailto: protocol.  Also, you can only send plain text emails, and not HTML/RTF.

Bob
0
 
LVL 1

Author Comment

by:donniedarko801
ID: 16798661
just text
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16808975
What did you think about using mailto:?

Bob
0
 
LVL 6

Expert Comment

by:ctm5
ID: 16809137
We've been assuming that you can get the user's Outlook profile. Is that correct or do you need some ideas about that?

ctm5
0
 
LVL 1

Author Comment

by:donniedarko801
ID: 17013665
sorry about the delay, was on vacation
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Loops Section Overview
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

864 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