Stupid Question...

C

chakachimp

How does one send an email via a DIFFERENT SERVER in c#? I'm doing so
with the following code:

dim schema
schema = "http://schemas.microsoft.com/cdo/configuration/"

set objMessage = Server.CreateObject("CDO.Message")
set objConfig = Server.CreateObject("CDO.Configuration")

With objConfig.Fields
.Item(schema & "smtpserver") = "www.someotherserver.com"
.update
End With

Set objMessage = Server.CreateObject("CDO.Message")
With objMessage
Set .Configuration = objConfig
.From = "(e-mail address removed)"
.To = "(e-mail address removed)"
.Subject = "This is the subject"
.HtmlBody = "this is the body"
.Send
End With

Some Notes:
1) Someotherserver is another URL on the local network
2) The smtp server is where the website is broken, when I try and
restart it....
 
M

Mike Brind

How does one send an email via a DIFFERENT SERVER in c#? I'm doing so
with the following code:

dim schema
schema = "http://schemas.microsoft.com/cdo/configuration/"

set objMessage = Server.CreateObject("CDO.Message")
set objConfig = Server.CreateObject("CDO.Configuration")

With objConfig.Fields
.Item(schema & "smtpserver") = "www.someotherserver.com"
.update
End With

Set objMessage = Server.CreateObject("CDO.Message")
With objMessage
Set .Configuration = objConfig
.From = "(e-mail address removed)"
.To = "(e-mail address removed)"
.Subject = "This is the subject"
.HtmlBody = "this is the body"
.Send
End With

Some Notes:
1) Someotherserver is another URL on the local network
2) The smtp server is where the website is broken, when I try and
restart it....

Try:

With objConfig.Fields
.Item(schema & "smtpserver") = "smtp.someotherserver.com"
.update
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top