drlease2000
11-12-2001, 01:33 PM
I have been trying to figure out what I'm doing wrong on this one. It seems that it should work. What I have is a vb form that is logging information (ie Customer Name, Company Name, address.......) and writing it to a file. When the User Submits this info, it creates the file and then launces the default email client to send that information back to me. The part I'm having problems with is getting my program to take the info that is in the registration file created by the app and sticking it into the BODY of the email to send to me. Here's what I've tried with no success.
Private Sub btnSendInfo_Click()
FileNum = FreeFile
Open "C:\reg.txt" For Append As FileNum
Write #FileNum, txtCustomerName.Text, txtCompanyName.Text, txtCompanyAddress.Text, _
txtCompanyCity.Text, txtCompanyState.Text, txtCompanyZip.Text, _
txtCompanyPhone.Text, txtCompanyFAX.Text, txtCompanyEmail.Text
Close FileNum
FileNum = FreeFile
Open "C:\reg.txt" For Input As FileNum
EmailBody = Input(LOF(FileNum), FileNum)
Close FileNum
email = "Start mailto:drlease2000@msn.com"
email = email & "?Subject=Catalog CDROM Registration"
email = email & "&Body="
email = email & "EmailBody"
Shell (email), vbHide
End Sub
Although I'm sure there is a better way to do this, I can't see why this way doesî't work. All I get is a new email window with the "To" filled in and the first word of the "Subject" filled in. So I know some of it is working.
Please keep in mind that I'm new to this and the mere fact that I'm using 4.0 should reaffirm that fact. However any help at this point would be appreciated
Private Sub btnSendInfo_Click()
FileNum = FreeFile
Open "C:\reg.txt" For Append As FileNum
Write #FileNum, txtCustomerName.Text, txtCompanyName.Text, txtCompanyAddress.Text, _
txtCompanyCity.Text, txtCompanyState.Text, txtCompanyZip.Text, _
txtCompanyPhone.Text, txtCompanyFAX.Text, txtCompanyEmail.Text
Close FileNum
FileNum = FreeFile
Open "C:\reg.txt" For Input As FileNum
EmailBody = Input(LOF(FileNum), FileNum)
Close FileNum
email = "Start mailto:drlease2000@msn.com"
email = email & "?Subject=Catalog CDROM Registration"
email = email & "&Body="
email = email & "EmailBody"
Shell (email), vbHide
End Sub
Although I'm sure there is a better way to do this, I can't see why this way doesî't work. All I get is a new email window with the "To" filled in and the first word of the "Subject" filled in. So I know some of it is working.
Please keep in mind that I'm new to this and the mere fact that I'm using 4.0 should reaffirm that fact. However any help at this point would be appreciated