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

Problems with E-mail script in access

Status
Not open for further replies.

Gaffi1

Technical User
Apr 23, 2004
70
0
0
US
Before I get the usual scolding reply of did you search the forums and did you read the FAQ's, the answer is yes. I've read everything I can find searching for e-mail, smtp, and object required. I have tried various script options and all of them have so far failed.

The various forms of error messages I get all relate to an object being required. I have checked that all the proper references are checked.

The goal, is to simply be able to send an email to x address with an attachment, without using a client. Reason, the database is used by multiple users via a remote desktop/terminal services client connection to a server with no email configuration. Server information, Windows 2000 Terminal.

To answer the pending comment of why don't you just configure the client, our systems group doesn't want to due to security, believe me, I wish I could. Also, I may not install any stand alone tools either.

I realize code would be more useful, but I haven't included it because I have used at least 5 different variations and all have failed with the exact same problems. Searching for email or smtp will provide you with example scripts. I'm simply hoping someone ran into a simular road block or has experience with blasting through it. Thanks!
 
Gaffi1,
not sure if you can do it without the client. why not copy / ftp the file to a box that has a client and send from there? you could also look into blat, but i believe you'll need the client for that - but you could use it on the 2nd box.
regards,
longhair
 
I have not been able to do it without an email client either (luckily I don't have the same restrictions :)) but I will be keeping an eye on this one to see if it is possible. I agree with longhair that ftp would be easy enough to use, but if it's a security issue is ftp even allowed on there?
 
Have you tried to play with CDO ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
re: FTP/Copying files, it can be done, just not exactly what I'm looking for, though might end up having to.

re: CDO, I sure did. With CDO, CDOSYS, CDONTN or something like that all received various versions of "object required".

This is so frustrating, lol... thanks for your continued help.
 
all received various versions of "object required".
I agree an object must be instantiated before it can be used.
Nevertheless, without seing code ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Gaffi-
Not sure if you've figured this out by now but if not,
you need to have IT people set up an SMTP gateway through your company's email client. This script will help you to send the email.

Code:
Dim cdoMail
Dim cdoCon


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 'save record before proceeding

    Set cdoMail = CreateObject("CDO.message")
    Set cdoCon = CreateObject("CDO.Configuration")
    Set iFields = cdoCon.Fields
    iFields.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2 'Set send method to SMTP
    iFields.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "IP.ADDRESS" 'designate server to generate email from
    iFields.Update
    Set cdoMail.Configuration = cdoCon
    
    With cdoMail                 
        .From = "user@company.com" 'using SMTP this can be a fake (no reply) address if you want
        .To = "user1@company.com; user2@company.com"
        .Cc = Forms("Form").Controls("Requestor").Value
        .Subject = "define subject here"
        .TEXTBody = "define body here (be sure to specify TEXTbody or HTMLbody)"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top