Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendin Email from VB with/without email account 1

Status
Not open for further replies.

NewGuy

Programmer
Dec 28, 2000
31
CA
I am making a program and have to have the VB 5 program send a message to the local H.R. dept.

I need something quick and small and that will work whether the user has an email account open or not.

I thought I had a sample from somewhere to do this, but it has vanished from my PC.

Can someone help????? Very little experience in programming
But I do know VB5, InstallShield Express 2.1X
and Access 97.
 

If you have Outlook then you can use the solution in faq222-179. If you don't have it then hopefully someone else has the answer!
Tarek

The more I learn, the more I need to learn!
 
Thank you VB400.

However, I thought I found something that could be used without the need to have outlook or any other email program opened.

Basically, if the user of my program has absolutely no email program on their computer I want my program to be able to send out a message.

But, I think this might take a lot of programming and I was looking for a quick and easy way.

So any one else have any thoughts????

If not, I guess I have a lot of code writing and testing ahead of me.

Thank you one and all. Very little experience in programming
But I do know VB5, InstallShield Express 2.1X
and Access 97.
 
If you need something really quick and really small you could simply send messages over the network. This is nothing like email but it works quite well for small messages.

VCA.gif

Alt255@Vorpalcom.Intranets.com

"If you can get people to ask the wrong questions, they'll never find the right answers."[tt]
Thomas Pynchon[/tt]

Perhaps the reverse is also true....
 
I've seen winsock used, but Access won't recognize it on our systems anymore. We had it in a db as an OLE object, and whoever put it there somehow knew the code. My problem now is that Access won't recognize any of the code. I haven't made changes that I know of that would affect winsock, and I don't know of a change in winsock on our systems. It apparently worked well until now. Now, I'm looking either for a way to get it going again or for some other free third-party software.

Third-party software sounds like what you need, too. The problem is finding something good and free. I've done a lot of searching. The URL from Alt255 looks good if that does what you need. If it must be e-mail, I'm still looking for the answer myself.
 
What about using CDO? This should work on Win2K systems anyway and others where the CDO libs are installed, I suppose:



' Code follows
Dim objCDO
Set objCDO = CreateObject("CDO.Message")
With objCDO
.To = "Enter Your Email Address Here"
.From = "Enter Your Email Address Here"
.Subject = "Enter Your Email Subject Here"
.TextBody = "Enter Your Email Body Here"
.Send
End With
Set objCDO = Nothing
' End of code


Regards,
Tom Rogers
TJRTech, Inc.
 
Hey New Guy,

Someone helped me with this a while ago. Here is the quick and dirty answer. The code will work just like clicking a web link. i.e. When you click the emailto: link on a web page it opens Outlook, if you don't have outlook it will go into Yahoo or something else that is your default mail program.

And the code in 1 line or less.
[tt]
ShellExecute Me.Hwnd, vbNullString, "mailto:" & Your Name Here & "? Subject=" & EmailSubject, vbNullString, "C:\", 1)[/tt]

Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
opps take the ) off the end. Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
I finally found what I was looking for. has a Winsock e-mail download (#7 in the list). It has VB code and a dll for it. Set a reference to mailer.dll (in the download), and use the Mailer.cMail code at the end of frmdriver.frm. 7 lines of code. Of course, you would need to put mailer.dll on any system that will use the code.
 
The advantage for my app with devmailer is that it does attachments. Peter Meachem
peter@accuflight.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top