Re: how to send email to extranet
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Tue, 25 Mar 2008 08:51:47 +0100
"£¤£¤£¤" <eagle@xxxxxxxxxxx> wrote in message
news:usDQAlkjIHA.484@xxxxxxxxxxxxxxxxxxxxxxx
It works well to send email to intranet email-box.
If I try to send email to a extranet email-box,the script will issue the
following information when it executes the last line " objEmail.send "
------ information---------
(null): The server rejected one or more recipient addresses. The server
response was: 554 Relay rejected for policy reasons.
####################VBS code#############
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "name@xxxxxxxxxx"
objEmail.To = "extranet@xxxxxxxxxx"
objEmail.Subject = "Server down"
objEmail.Textbody = "No longer accessible over the network."
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"192.168.0.1" 'this is mail server IP.
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
You've got most of the required stuff in your code but you need
to replace the SMTP server's IP address with name of your ISP's
SMTP server. Here is a modified version of your code. I have
tightened it up a little to make it more readable.
schema = "http://schemas.microsoft.com/cdo/configuration/"
Set objEmail = CreateObject("CDO.Message")
With objEmail
.From = "name@xxxxxxxxxx"
.To = "extranet@xxxxxxxxxx"
.Subject = "Server down"
.Textbody = "No longer accessible over the network."
' .AddAttachment "d:\Testfile.txt"
With .Configuration.Fields
.Item (schema & "sendusing") = 2
.Item (schema & "smtpserver") = "mail.SomeISP.com"
.Item (schema & "smtpserverport") = 25
.Item (schema & "smtpauthenticate") = cdoBasic
.Item (schema & "sendusername") = "name@xxxxxxxxxx"
.Item (schema & "sendpassword") = "SomePassword"
End With
.Configuration.Fields.Update
.Send
End With
.
- Follow-Ups:
- Re: how to send email to extranet
- From: £¤£¤£¤
- Re: how to send email to extranet
- References:
- how to send email to extranet
- From: £¤£¤£¤
- Re: how to send email to extranet
- From: Pegasus \(MVP\)
- Re: how to send email to extranet
- From: £¤£¤£¤
- how to send email to extranet
- Prev by Date: Re: how to send email to extranet
- Next by Date: Re: how to send email to extranet
- Previous by thread: Re: how to send email to extranet
- Next by thread: Re: how to send email to extranet
- Index(es):
Relevant Pages
|