Sending Emails (1 Viewer)

NOL

Registered User.
Local time
Today, 12:24
Joined
Jul 8, 2002
Messages
102
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.
 

NOL

Registered User.
Local time
Today, 12:24
Joined
Jul 8, 2002
Messages
102
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
 

ler1992

New member
Local time
Today, 11:24
Joined
Oct 3, 2002
Messages
6
Attachments

Does anyone know how to add an attachment with using the SMTP method?
 

matt020876

Registered User.
Local time
Today, 17:24
Joined
Jan 8, 2003
Messages
10
Trying to do something similar but we will be sending something out on a CD - anyway to detect the SMTP settings?
 

chewy

SuperNintendo Chalmers
Local time
Today, 17:24
Joined
Mar 8, 2002
Messages
581
what needs to be registd for access 97 and outlook 2000?
 

chewy

SuperNintendo Chalmers
Local time
Today, 17:24
Joined
Mar 8, 2002
Messages
581
so in order for this to work this has to be sen to a server somewhere?
 

NOL

Registered User.
Local time
Today, 12:24
Joined
Jul 8, 2002
Messages
102
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
 

chewy

SuperNintendo Chalmers
Local time
Today, 17:24
Joined
Mar 8, 2002
Messages
581
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?
 

NOL

Registered User.
Local time
Today, 12:24
Joined
Jul 8, 2002
Messages
102
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.
 

chewy

SuperNintendo Chalmers
Local time
Today, 17:24
Joined
Mar 8, 2002
Messages
581
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!
 

Rjc8513

New member
Local time
Today, 17:24
Joined
Jan 25, 2001
Messages
6
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.
 

chewy

SuperNintendo Chalmers
Local time
Today, 17:24
Joined
Mar 8, 2002
Messages
581
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.
 

chewy

SuperNintendo Chalmers
Local time
Today, 17:24
Joined
Mar 8, 2002
Messages
581
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

  • email.zip
    12.8 KB · Views: 268

chewy

SuperNintendo Chalmers
Local time
Today, 17:24
Joined
Mar 8, 2002
Messages
581
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
 

NOL

Registered User.
Local time
Today, 12:24
Joined
Jul 8, 2002
Messages
102
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.
 

jeff_i

Registered User.
Local time
Today, 12:24
Joined
Jan 24, 2003
Messages
50
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
 

chewy

SuperNintendo Chalmers
Local time
Today, 17:24
Joined
Mar 8, 2002
Messages
581
so basically I have made an email program through Access?
 

Users who are viewing this thread

Top Bottom