473,405 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Stupid Question...

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 = "fr******@domain.com"
.To = "to****@domain.com"
.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....

Apr 12 '06 #1
2 1091
excuse me, I really mean ASP (VBScript), not C#

Apr 12 '06 #2

ch********@yahoo.com wrote:
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 = "fr******@domain.com"
.To = "to****@domain.com"
.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

--
Mike Brind

Apr 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

119
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see,...
5
by: raz | last post by:
Greetings all. I apologize for what is almost certainly a stupid question, but I can't figure this out, and have no more time for head bashing... The short version: what is the appropriate...
4
by: IS | last post by:
At the recommendation of several people in this newsgroup I have downloaded two or three Compilers. One is the Beta version of Microsoft's Visual C++ 2005. I have entered a complete beginner code...
2
by: Ron Weldy | last post by:
I read that you don't need .cs files to deploy but I suppose if you are trying to reconstruct someone's work, you will need these files. Is that correct?
3
by: rroman | last post by:
I have a very simple form, takes information from the user, updates a SQL database, now I just want to redirect to a "Thank You For Your Time" web page within the same bowser. ASP. NET VB
6
by: Adam Smith | last post by:
I have posted this and similar questions repeatedly and can't even raise a single response. I am being led to believe that this then 'Must be a stupid question' although people say that there is no...
5
by: Alberto Salvati | last post by:
Hi, List. My company has a VERY BIG product base on db2 udb v7.x. We want to di an upgrade to v9, but.... current db has a lot of procedure (cobol..!). Therefore, we've planned to rewrite this...
2
by: Lynx101 | last post by:
Hi, Is this a stupid question? Senario: Two tables linked together with an ID number. Question: When using a combo box, which refences another table by indexed autonumber, is there a way to...
9
by: AWW | last post by:
Running XP - Visual Studio 2005 - VB Want to have duplicate projects - one safe and stable - other for experimenting Can't fine easy way to make duplicate project. Stupid question? or stupid ME?...
9
by: Alec | last post by:
Sorry guys, stupid question.... Am no programming expert and have only just started using php for creating dynamic news pages. Then I see a dynamic website without the php extension. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.