473,327 Members | 2,112 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,327 software developers and data experts.

How to send email to another person with using Microsoft Visual Basic 6.0.?

How to send email to another person with using Microsoft Visual Basic 6.0.?
Jun 5 '07 #1
3 2897
How to send email to another person with using Microsoft Visual Basic 6.0.?

Dear Friend,

Try this code, it perfectly worked for me (but the important point it will automatically send mail through outlook so please make sure that your outlook is configured before using this script)

Dim olApp As Outlook.Application
Dim olNs As Outlook.NameSpace
Dim olItem As Outlook.ContactItem
Dim olMail As Outlook.MailItem
Set olApp = CreateObject("Outlook.Application")
Set olItem = olApp.CreateItem(olContactItem)
Set olMail = olApp.CreateItem(olMailItem)
With olItem
.Email1Address = Address
End With
olMail.To = olItem.Email1Address
olMail.subject = subject
olMail.Body = Content
olMail.Send
Jun 10 '07 #2
neo008
85
What if I dont want to configure outlook? Is there some method to do by scripts like a command button will mail a text box details?

NE☼
Jun 12 '07 #3
ansumansahu
149 100+
What if I dont want to configure outlook? Is there some method to do by scripts like a command button will mail a text box details?

NE☼
Hi ,

You can use Microsoft MAPI Controls 6.0.

good luck
-ansuman sahu
Jun 12 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: MLH | last post by:
I want to send 2 reports using SendObject. Something like this would do nicely... DoCmd SendObject A_REPORT, "rpt1";"rpt2", A_FORMATRTF, MyRecip, , , MySubject, MyBodyText, 0 ....except for...
2
by: Alex | last post by:
Hi, My booking system sends a HTML formated email as a recipt to the client on completion of their booking. All is working well however it has been pointed out to me that not all people's email...
15
by: cj | last post by:
How can I get a button in VB to send the contents of a text box via email in a manner similar to the "Send To\Mail Recipient" functionality that you can select via right clicking a file in Windows...
4
by: Max | last post by:
hi I am using System.Web.Mail.MailMessage with System.Web.Mail.SmtpMail to send mail. now the my question is, Is it compulsory to add fields smtpauthenticate, sendusername and sendpassword...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.