Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to send email from access form without Outlook?

Posted on 2012-08-22
10
Medium Priority
?
1,692 Views
Last Modified: 2012-08-23
Anyone know of a way to send an email from an access form without using Outlook? The computer that is being used by the users will not have outlook setup on it and my current vba I'm using only sends emails from outlook.

Oh and this is in Access 2010

Thanks in advance!
0
Comment
Question by:SeyerIT
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 9

Assisted Solution

by:TazDevil1674
TazDevil1674 earned 1600 total points
ID: 38320942
Set objMessage = CreateObject("CDO.Message") 
objMessage.Subject = "SUBJECT" 
objMessage.From = "FROM" 
objMessage.To = "TO" 
objMessage.TextBody = "TEXT BODY"
objMessage.AddAttachment "ATTACHMENT1"
objMessage.AddAttachment "ATTACHMENT2"
objMessage.AddAttachment "ATTACHMENT3"
objMessage.Send

Open in new window

0
 
LVL 2

Author Comment

by:SeyerIT
ID: 38320967
I just tried that code and got the following error;
 error
Do I need to Dim the objMessage as something?
0
 
LVL 9

Expert Comment

by:TazDevil1674
ID: 38321022
Sorry, no coding expert - I use it using VBS so may need slight tweak for VBA...
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:SeyerIT
ID: 38321033
OK, thanks anyhow.. I'll wait and see what other input I get.
0
 
LVL 1

Expert Comment

by:jjnet123
ID: 38321047
Do they have any mail client at all installed? This could be possible, but would be very complicated (you would effectively have to make Access a mail client).

Alternatively perhaps there's a webmail service you could integrate with.
0
 
LVL 2

Author Comment

by:SeyerIT
ID: 38321048
Yes we use exhange accounts.
0
 
LVL 1

Expert Comment

by:jjnet123
ID: 38321249
Do you mean that you use Exchange, and use Outlook Web Access?

If so, I think you'll struggle.

Thinking 'outside the box', if you have a network and multi user access to your DB, you could perhaps nominate one machine with Outlook installed to send the mail for you... it's possible to do this silently (e.g. without the user pressing 'send').
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 400 total points
ID: 38321440
0
 
LVL 9

Accepted Solution

by:
TazDevil1674 earned 1600 total points
ID: 38321821
I found a different VBS script that I have used - you will need to ensure that SMTP relay is enabled for the IP of the PC/Server this is sending from, you may also need to set up an exchange user and enter the details (commented out at present)

Set email = CreateObject("CDO.Message")
email.Subject = "TEST"
email.From = "VBS User<VBS@Company.com>"
email.To = "Bloggs Joe <jb@company.com>"
email.TextBody = "Test SMTP"
email.AddAttachment "c:\document.txt"
'email.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "UserName"
'email.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PassWord"
email.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")= 2
email.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="exchange.company.com"
email.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
email.Configuration.Fields.Update
email.Send
set email = Nothing

Open in new window

0
 
LVL 2

Author Closing Comment

by:SeyerIT
ID: 38324454
Thanks for all the help!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question