Page 1 of 1 1
Topic Options
#115748 - 2004-03-09 04:24 PM Sending Mail
tr6boy Offline
Starting to like KiXtart

Registered: 2001-10-24
Posts: 131
I don't know email technology very well, so I just have a basic question about sending a message from within a KiXtart script. If I use Blat, or maybe Howard's Win32Admin.dll, which machine needs to have the ability to SMTP relay - the user PC, or the authenticating domain controller?

I know I won't be able to enable SMTP relay on all of my users, but from the domain controllers would be OK I think. Is that how it works, or can it be made to work that way?

Thanks,
Mark

Top
#115749 - 2004-03-09 04:28 PM Re: Sending Mail
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA


The SMTP server you're using is handling all email. This has nothing per se to do with the client computer or the domain controllers. So, just use the same SMTP server you're using for your regular mail.
_________________________
There are two types of vessels, submarines and targets.

Top
#115750 - 2004-03-09 04:55 PM Re: Sending Mail
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Bit of an odd question really.

If you use something like BLAT, it is a stand-alone SMTP client, i.e. it needs to talk to an SMTP server.

The SMTP server can be any one that is prepared to accept and relay SMTP email, whether that is a Linux box running smtpd, an Exchange server with an Internet mail connector or your ISPs email servers.

Other than BLAT, you don't need any other software installed to send SMTP mail, in fact you can simply run the executable from a share, so all of your users' machines can participate.

Top
#115751 - 2004-03-09 05:06 PM Re: Sending Mail
tr6boy Offline
Starting to like KiXtart

Registered: 2001-10-24
Posts: 131
OK, so let's say more specifically I want to use Howard's method. So I need to register the dll, which I did on my test machine. Then I tried to execute the code as follows:

Code:
 
Method Email($MailHost, $To, $From, $Subject, $Body)
; Sends an email from your script.
; Be sure to double the "@" in the email address.
$Win32Admin = createobject("Win32Admin")

$mailhost = 'smtp.cintas.com'
$to = 'creamerm@@cintas.com'
$from = 'creamerm@@cintas.com'
$subject = 'Test Message'
$body = 'Email from KiXtart is great!'

if $Win32Admin.Email($mailhost, $to, $from, $subject, $body)
? ? "Email to " + $to + " sent."
?
else
? ? "Email Failed! @serror"
?
endif



The script completes, but I never receive the email.

My machine is an Outlook client to an Exchange server, which is also our SMTP server. I thought that in order for my machine to send that message via a non-Outlook client, the Exchange server would have to be configured to allow me to relay the message off of it. But if from your reply, you're saying that's not the problem, what else might I check?

Thanks Jens,

Top
#115752 - 2004-03-09 05:21 PM Re: Sending Mail
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Use telnet to test the SMTP connection from the machine.

Here is a sample session.
Start a DOS session, type in the items in bold:

C:\Windows>telnet smtp.cintas.com 25

220 smtp.cintas.com SMTP V05R02M00 on Tue, 10 Feb 2004 11:41:46 +0100.

helo mypc.cintas.com

250 smtp.cintas.com.

mail from: <creamerm@cintas.com> From display name

250 OK.

rcpt to: <creamerm@cintas.com> To display name

250 OK.

data

354 Enter mail body. End mail with a '.' in column 1 on a line by itself.

Subject: Type mail subject here



You must leave a blank line after the mail headers (like Subject)

Type your message, then type a “.” on it’s own to end the message.

.


250 OK.

quit


Top
#115753 - 2004-03-09 06:43 PM Re: Sending Mail
tr6boy Offline
Starting to like KiXtart

Registered: 2001-10-24
Posts: 131
Telnet sessions to port 25 are immediately disconnected. Isn't that just because that's how the Exchange admins have it set up? I thought that was pretty common...
Top
#115754 - 2004-03-09 07:44 PM Re: Sending Mail
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Are you in the same IP class as the SMTP server? It is common practice to deny from all but the same IP to keep others from bouncing mail. If the IP classes are different, you would probably want to setup a relay somewhere.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#115755 - 2004-03-09 09:33 PM Re: Sending Mail
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I would suggest asking the mail admins what DNS name should be used as the target for SMTP mail. We have a couple Unix computers that serve as our generic targets for SMTP mail.

I would have thought that you should have received an error from your script if the target server did not accept your email.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#115756 - 2004-03-09 10:31 PM Re: Sending Mail
tr6boy Offline
Starting to like KiXtart

Registered: 2001-10-24
Posts: 131
OK, I'll take it up with them. Thanks all, Mark
Top
#115757 - 2004-03-10 08:46 AM Re: Sending Mail
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
if the connection is disconnected, there probably is limitation to allow connections only from some host.
normally, relay is not needed for in-domain mails.
_________________________
!

download KiXnet

Top
#115758 - 2004-03-10 10:34 AM Re: Sending Mail
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
If you cannot telnet to port 25 you cannot send email via SMTP.

Are you sure that the mail host that you are trying to connect to is not an external name? Does the DNS name resolve to an internal or external address?

In well secured organisations the public SMTP host is either based at your ISP or is in a DMZ and is normally not directly accessible from internal hosts.

You need an internal host that will accept port 25 connections.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (mole) and 1300 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.101 seconds in which 0.063 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org