Sending Emails

Well i didn't modify any code , 'cept for the email id .
Besides i just need a simple send mail code, dunno if that's what you are lookign for.

Just copied and pasted the code by Russell Grice, Page 1 of this post with subject "Finally got it working"
________________________________________________
Added in references for CDO libraries and ActiveX library(although not sure if thats needed) nicked some code from MS site.

Public Function SendEMail_CDO(strFrom, strTo, strCC, strSubject, strBody)

Dim mail
Dim config
Dim fields

Set mail = CreateObject("CDO.Message")
Set config = CreateObject("CDO.Configuration")
Set fields = config.fields

With fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' SMTP SERVER
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "10.1.14.64" ' IP OF SERVER
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With

Set mail.Configuration = config

With mail
.From = strFrom
.To = strTo
.CC = strCC
.Subject = strSubject
.TextBody = strBody
.Send
End With

Set mail = Nothing
Set fields = Nothing
Set config = Nothing

End Function
------------------------------------------------------------------------------

Good Luck
:)

Gina.
 
u need to change the SMTP server address to your SMTP server IP .
and also change the email id.
apart from that , there are no changes.
don't forget to put in the refrences mentioned.

Gina
 
Attachments

Does anyone know how to add an attachment with using the SMTP method?
 
Trying to do something similar but we will be sending something out on a CD - anyway to detect the SMTP settings?
 
what needs to be registd for access 97 and outlook 2000?
 
so in order for this to work this has to be sen to a server somewhere?
 
Are you looking for your SMTP server ?

If you are using MS Outlook 2000, go to your inbox ,
right click on any email --> options.

in the internet headers you should be able to find the IP address of your SMTP server.

That's one way I know of finding it.

Gina
 
thanks for the reply. But when I do that it just shows a blank box for everyone. Does it matter that I am using exchange server?
 
No I don't think it matters
If u are using email, it means you have an SMTP server in your network!

I don't know why it doesn't show in your internet headers box.
hope u are looking in the right place.

U could try checking the options for a email which has come from sum1 outside your network.

If you can't find it , you could ask your IT resources heldesk, if you have one.
somene should definitely be able to provide you with the SMTP IP address.

I'm sorry I couldn't help much .
Gina.
 
I GOT IT HOLY CRAP!!!!!!! THANKS EVERYONE!!!!!

I just types in the server name! Wow its amazing how easy it is when you know how to do it!
 
Sending e-mails

Okay, I incorporated Russell's code into an Access function and have not been able to get it to work. Will it not run and can I not test it like all other Access functions in modules (F8 to step thru the code)? When I try, the step into/thru process will not start. What am I doing wrong?

Thanks.
 
i fuond out that it wroks inside our firewall, but when I try to send something to my hotmail account it says Server rejects, relaying prohibited error 550.
 
Here is a sample using the method talked about in this thread. All you have to do is change the SMTP server name in the code. It says in the comments where to look and also in this thread.
 

Attachments

I was thinking about what is happending here, and was wondering does this way of emailing actually use Outlook or for that matter any email program? It would seem that it is using any emails basic function of sending. So would this work without any email program being installed? Just a crazy thought!

Let me know if anyone else knows if im right
 
Hi chewy ,


u need not have an email 'client' like outlook installed , but you definitely need to have an up & running email server (e.g MSs exchange, Unix sendmail etc. ) installed somwhere in ur network ( which everyone wld have i guess )

the code uses smtp commands to communicate directly with ur smtp server .

I'm still lost about the use of the CDO object via the hyperlink.

ideas any1?
Gina.
 
NOL said:

.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' SMTP SERVER
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "10.1.14.64" ' IP OF SERVER
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With

First THANKs this works perfectly. I understand the principle of how this works but I don't understand the Hyperlinks to microsofts site? What is this for am I missing something?

The other question is do you have to have rights to the account of the sender? For instance how does this prevent someone from entering in another name?

Thanks,
Jeff
 
so basically I have made an email program through Access?
 

Users who are viewing this thread

Back
Top Bottom