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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emailing test results

Status
Not open for further replies.

Rickalty

Technical User
Jun 29, 2001
42
0
0
US
Hi everyone, I have an online test that is completed on a SharePoint site. When the user finishes the test, I'd like the results (the test is scored as it goes, and the results listed on a worksheet) to be emailed to me.

I know I can use "ActiveWorkbook.SendMail" to send the whole workbook to myslef, but what would be the easiest way to send just one page? Or, an even smaller file, just the contents (20 Y or N cells) as a text file?

Richard
 
Have a look here:
thread705-1369407

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks, I followed that link, and looked further into CDO, but can't get it to work.

I got this sample code...
Private Sub cmdFinished_Click()
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Sampling test results"
objMessage.From = "me@myserver.com"
objMessage.To = "me@myserver.com"
objMessage.TextBody = "This is some sample message text."
objMessage.Send

End

End Sub

But it errors out with the message "The 'sendusing' configuration value is invalid."

Any help please?

Richard
 
All is clearly explained in the thread I've suggested to you.
Seems like you missed the CDO configuration part:
Code:
With objMessage.Configuration.Fields
  .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2
  .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "smtp.someserver.com"
  .Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 25
  .Update
End With

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 


You sure did not follow the bouncing ball very well!

I did not see any configuration/field objects in your code.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Sorry, I had missed copying over some of the code :-(

Here is the full coding I am using now...

Private Sub cmdFinished_Click()
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Sample test results message"
objMessage.Sender = "rickalty@myserver.com"
objMessage.To = "rickalty@myserver.com"
objMessage.TextBody = "Test results go here."
With objMessage.Configuration.Fields
.Item(" = 2
.Item(" = "smtp.myserver.com"
.Item(" = 25
.Update
End With
objMessage.Send

End

End Sub

The error message I get now is "The transport failed to connect to the server". I've checked with our IT desk and they confirm that our SMTP server is smtp.myserver.com.

I have also checked in 'Add or Remove Programs" that CDO is installed.

I have Outloook running, using MS Exchange Server.
 
Never mind...... Our SMTP server is mail.myserver.com, not smtp.myserver.com

I made the change and it works fine.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top