Solved

Send Simple Email with Visual Basic 6

Posted on 2004-04-22
11
327 Views
Last Modified: 2013-11-25
Hi.

I would like to send a simple email using a feedback form I have created. I have tried MAPI, but that opens your default email client.

All I have is a Your Name box, a Your Email Adress box, two radio buttons for feedback/bug report (more may be added, I'm not sure), and a details box.
I would like it to send to an email address preferably defined in the code, with a subject that changes depending on which of the two radio buttons is selected; I want the email to appear something like this:

Name: John Smith
Email: someone@experts-exchange.com
Selected Topic: Feedback
Details: Hmm~

Yes, I am a newbie at VB... Any help would be great!
0
Comment
Question by:Kane00
11 Comments
 
LVL 3

Expert Comment

by:rinksno1
ID: 10886899
well first thing is that you need an isp mail ie. a pop enabled mail to enable sending mails using vb in mapi too you must have a pop email account to use the mailing feature, you cannot send your mails using yahoo,hotmail and other free email providers with your vb application.

rinks
0
 

Author Comment

by:Kane00
ID: 10886913
Ok, say i want to use by bigpond email for it. Then what?
0
 
LVL 1

Accepted Solution

by:
lalithaw earned 50 total points
ID: 10886959
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 4

Expert Comment

by:Javin007
ID: 10889665
I'd send ya to look at the POP3 RFC, but it's written by a drunken goat.

Basically, just make a winsock connection to the server, and it'll immediately respond with a 220 reply saying "Hi, I'm so and so."  Then you do the following.  Remember any numbered response is the response you EXPECT to see from the server.  The commands are the caps things that you'll actually SEND to it through winsock (don't forget to end all of your lines you send with vbCrLf:

220 Hiya!  Welcome to ye' ol' generic E-Mail app.
HELO MyDomain.Com
250 OK
MAIL FROM:<ReturnAddress@MyDomain.com>
250 OK - mail from <ReturnAddress@MyDomain.com>
RCPT TO:<ThisGuy@yahoo.com>
250 OK - Recipient <ThisGuy@yahoo.com>
RCPT TO:<ThisGuyToo@aol.com>
250 OK - Recipient <ThisGuy@yahoo.com>
DATA
354 Okeydokie, send the data sparky.

Here it gets a little interesting.  This is where you actually build the E-Mail.  There's a THOUSAND different ways to build the E-Mail, but the basics are:

From: ReturnAddress@MyDomain.com
To: ThisGuy@yahoo.com, ThisGuyToo@aol.com
CC:
Subject: Buy Cheap Viagra Online!
Mime-Version: 1.0
Content-Type: text/plain;charset="us-ascii"

Now this is where you put all the text that's in the body of the message.  When you get to the end of the message, you end it with a carriage return/line feed/period/carriage return/linefeed.  (vbCrLf & "." & vbCrLf)  Once that's entered, you'll receive an OK command, and will need to terminate your connection gracefully:

250 - OK
QUIT

That help?

-Javin
0
 

Author Comment

by:Kane00
ID: 11256984
Sorry, none of your solutions work.

Admin please close this question.
0
 

Author Comment

by:Kane00
ID: 11266851
Where can I get the vbSendMail.DLL?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 11273166
Read the posts in this question.  In particular: http:#10886959
0
 

Author Comment

by:Kane00
ID: 11412791
No solutions were suitable for my needs but I will accept one anyway to get the admins off my back....
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
base64 decode encode 12 133
Access Object Property from VBA Module in Excel 2010 2 31
Visual Studio 2005 text editor 10 38
Bartender label printing - switch on and off graphics 3 36
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

808 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