473,396 Members | 1,812 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,396 software developers and data experts.

Code equivalent for this.......Help

HI,

Below is the code in vb to send mail using CDO object. I
want to do the same in VB.Net , i need to know how to sent
the authentication in vb.net "
..Item(cdoSMTPAuthenticate) = cdoBasic"


VB
-------------------------------------------------------

Dim iMsg as New CDO.Message
Dim iConf as New CDO.Configuration

Dim Flds as ADODB.Fields
Set Flds = iConf.Fields

With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerName)
= "so******@microsoft.com"
.Item(cdoSMTPConnectionTimeout) = 10 ' quick timeout
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "username"
.Item(cdoSendPassword) = "password"
.Item(cdoURLProxyServer) = "server:80"
.Item(cdoURLProxyBypass) = "<local>"
.Item(cdoURLGetLatestVersion) = True
.Update
End With

With iMsg
Set .Configuration = iConf
.To = """User A"" <us***@microsoft.com>"
.From = """User B"" <us***@microsoft.com>"
.Subject = "Hows it going? I've attached my web
page"
.CreateMHTMLBody "http://mypage"
.AddAttachment "C:\files\mybook.doc"
.Send
End With
-------------------------------------------------------

thanks
Nov 17 '05 #1
2 1680
Hi Jyakumar,

Please refer the System.Web.Mail namespace. This is the CDO implementation
in .net world. Please refer the following link.
http://www.codeproject.com/useritems/epsendmail.asp

--
Let me know if you need further help

Regards
Sreejumon[MVP]
www.mstechzone.com

"jayakumar" <ja********@hotmail.com> wrote in message
news:08****************************@phx.gbl...
HI,

Below is the code in vb to send mail using CDO object. I
want to do the same in VB.Net , i need to know how to sent
the authentication in vb.net "
.Item(cdoSMTPAuthenticate) = cdoBasic"


VB
-------------------------------------------------------

Dim iMsg as New CDO.Message
Dim iConf as New CDO.Configuration

Dim Flds as ADODB.Fields
Set Flds = iConf.Fields

With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerName)
= "so******@microsoft.com"
.Item(cdoSMTPConnectionTimeout) = 10 ' quick timeout
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "username"
.Item(cdoSendPassword) = "password"
.Item(cdoURLProxyServer) = "server:80"
.Item(cdoURLProxyBypass) = "<local>"
.Item(cdoURLGetLatestVersion) = True
.Update
End With

With iMsg
Set .Configuration = iConf
.To = """User A"" <us***@microsoft.com>"
.From = """User B"" <us***@microsoft.com>"
.Subject = "Hows it going? I've attached my web
page"
.CreateMHTMLBody "http://mypage"
.AddAttachment "C:\files\mybook.doc"
.Send
End With
-------------------------------------------------------

thanks

Nov 17 '05 #2
Whatever account ASP.Net is running under, that is the account that is
sending the mail. Just add that account to the SMTP Server's authenticated
operators.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"jayakumar" <ja********@hotmail.com> wrote in message
news:08****************************@phx.gbl...
HI,

Thanks, but my smtp server is authenticated. How do u
specify the Username and password for the server.

-----Original Message-----
Hi Jyakumar,

Please refer the System.Web.Mail namespace. This is the

CDO implementation
in .net world. Please refer the following link.
http://www.codeproject.com/useritems/epsendmail.asp

--
Let me know if you need further help

Regards
Sreejumon[MVP]
www.mstechzone.com

"jayakumar" <ja********@hotmail.com> wrote in message
news:08****************************@phx.gbl...
HI,

Below is the code in vb to send mail using CDO object. I want to do the same in VB.Net , i need to know how to sent the authentication in vb.net "
.Item(cdoSMTPAuthenticate) = cdoBasic"


VB
-------------------------------------------------------

Dim iMsg as New CDO.Message
Dim iConf as New CDO.Configuration

Dim Flds as ADODB.Fields
Set Flds = iConf.Fields

With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerName)
= "so******@microsoft.com"
.Item(cdoSMTPConnectionTimeout) = 10 ' quick timeout
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "username"
.Item(cdoSendPassword) = "password"
.Item(cdoURLProxyServer) = "server:80"
.Item(cdoURLProxyBypass) = "<local>"
.Item(cdoURLGetLatestVersion) = True
.Update
End With

With iMsg
Set .Configuration = iConf
.To = """User A"" <us***@microsoft.com>"
.From = """User B"" <us***@microsoft.com>"
.Subject = "Hows it going? I've attached my web
page"
.CreateMHTMLBody "http://mypage"
.AddAttachment "C:\files\mybook.doc"
.Send
End With
-------------------------------------------------------

thanks

.

Nov 17 '05 #3

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

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
0
by: Josiah Carlson | last post by:
Good day everyone, I have produced a patch against the latest CVS to add support for two new formatting characters in the struct module. It is currently an RFE, which I include a link to at the...
5
by: Ahmad | last post by:
Hi all, I have written a simple c++ app, as I'm still learning c++. The thing works flawlessly on VC++6, but just doesn't work on g++. The transliterate function which causes the problem is...
12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
8
by: Paul Cochrane | last post by:
Hi all, I've got an application that I'm writing that autogenerates python code which I then execute with exec(). I know that this is not the best way to run things, and I'm not 100% sure as to...
6
by: arnold | last post by:
HI I 've been trying to find the equivalent code in C# but I did not succeed. What is the equivalent of Collection in C#? Dim c_colNewCustomerDataRows As New Collection() If...
8
by: Nikkita | last post by:
Software such as Excel or Word exposes a COM object model which allows them to be automated by any language that can call COM objects. As I understand it, I can do the same in VB6 by writing an...
1
by: jeeji | last post by:
HI I am experiencing something funny here where I have two equivalent queries: If I run them through query analyzer, the first runs slower than the second, but if run through C# application, the...
29
by: Ancient_Hacker | last post by:
A while back I had to recompile some old code, originally written by a really good programmer, but one prone to use every trick in the book, and then some. There was a statement, something like...
7
by: tararreb | last post by:
#include<stdio.h> /*This line is standard input output, # is directive, include is keyword, and stdio.h is header file*/ #include<stdlib.h> /*This line is standard input output, # is directive,...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.