Showing posts with label below. Show all posts
Showing posts with label below. Show all posts

Saturday, March 31, 2012

SendingEMail

I have an ASP.NET web app that I am trying to sens an email from. I use
the code below to send it.
mailMsg := MailMessage.Create;
mailMsg.From := self.Session['SMTPADDRESS'].ToString;
mailMsg.&To := aEMail;
mailMsg.BCC := aAdminEMail;
mailMsg.Subject := 'Your LoginID and Password';
mailMsg.BodyFormat := MailFormat.Text;
mailMsg.Body := 'Your LoginID is '''+aLogin+''' and Password
'''+aPassword+'''';
SmtpMail.SmtpServer := aSMTPServer;
SmtpMail.Send(mailMsg);
My mail server requires password authentication. Where do I assign the
password?
TIAThe following solution is officially unsupported - but it works (you
otherwise need to use CDO or something else to authenticate).
Add these lines to your code before you call SmtpMail.Send()
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthe
nticate",
"1"); //basic authentication
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusern
ame",
myLoginID); //set your username here
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassw
ord",
myPassword); //set your password here
-HTH
"gh" <gh@.at.ne> wrote in message
news:OFCyfZsjFHA.3012@.TK2MSFTNGP12.phx.gbl...
>I have an ASP.NET web app that I am trying to sens an email from. I use
>the code below to send it.
> mailMsg := MailMessage.Create;
> mailMsg.From := self.Session['SMTPADDRESS'].ToString;
> mailMsg.&To := aEMail;
> mailMsg.BCC := aAdminEMail;
> mailMsg.Subject := 'Your LoginID and Password';
> mailMsg.BodyFormat := MailFormat.Text;
> mailMsg.Body := 'Your LoginID is '''+aLogin+''' and Password
> '''+aPassword+'''';
> SmtpMail.SmtpServer := aSMTPServer;
> SmtpMail.Send(mailMsg);
> My mail server requires password authentication. Where do I assign the
> password?
> TIA
Check this out
http://www.systemwebmail.com/faq/3.8.aspx
info@.donotspam dowhileloop.com
http://www.dowhileloop.com -- Website Development
http://publicjoe.dowhileloop.com -- C# & VB.NET Tutorials
"gh" <gh@.at.ne> wrote in message
news:OFCyfZsjFHA.3012@.TK2MSFTNGP12.phx.gbl...
> I have an ASP.NET web app that I am trying to sens an email from. I use
> the code below to send it.
> mailMsg := MailMessage.Create;
> mailMsg.From := self.Session['SMTPADDRESS'].ToString;
> mailMsg.&To := aEMail;
> mailMsg.BCC := aAdminEMail;
> mailMsg.Subject := 'Your LoginID and Password';
> mailMsg.BodyFormat := MailFormat.Text;
> mailMsg.Body := 'Your LoginID is '''+aLogin+''' and Password
> '''+aPassword+'''';
> SmtpMail.SmtpServer := aSMTPServer;
> SmtpMail.Send(mailMsg);
> My mail server requires password authentication. Where do I assign the
> password?
> TIA

Thursday, March 29, 2012

Seperator between two specific menu items in asp:menu which uses a Sitemap

Let's say I have a sitemap like below. I use this in an asp:Menu and I ONLY want a seperator between link 2 and link 3.  How would I go about achieveing this. 
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url ="~/Default.aspx" title="Home" description="Home"> <siteMapNode url ="~/Default1.aspx" title="link1" description="link1" /> <siteMapNode url ="~/Default2.aspx" title="link2" description="link2" /> <siteMapNode url ="~/Default3.aspx" title="link3" description="link3" /> </siteMapNode></siteMap>
Thanks

you dont... you'll have to either do this in the render event or page load event, by trying to dynamically insert some node or such.

If you are going to use the sitemap and bound technique you will be limited on what you can do.


I guess I'm kind of out of lucky with this approach then huh.

The only flaky solution I have seen so far is inserting another sitemapNode like so with an hr tag in it.

<siteMapNodeurl =""roles="*"

title="<hr style='color:grey;height:1px;font-size:1px' />"

description="" />


yup... that was my other suggestion, but that can really mess up links, etc...very kludge like


Ok I followed your other advice and added anSeparatorImageUrl to the specific node at runtime in the MenuItemDataBound Event. It's not perfect, but it's the best solution so far. In fact maybe it doesn't get better :).

Thanks.


Now the last issue I have with this solution is that the menu will expand to the size of the image used. Is there a way to make the image stretch to the size of the menu?

Monday, March 26, 2012

Serial port Class

I try to put a dropdownlist to specify COM port available on the computer by using the code below, however error occurs at My.Computer.Ports where it says that 'ports' is not a member of my.mycomputer

Imports System.IO

PartialClass _Default

Inherits System.Web.UI.Page

PrivateShared portAs System.IO.Ports.SerialPort =New System.IO.Ports.SerialPort()

ProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.Load

For iAsInteger = 0ToMy.Computer.Ports.SerialPortNames.Count - 1

DropDownList1.Items.Add( _

My.Computer.Ports.SerialPortNames(i))

Next

EndSub

End class

Try this:

For iAsInteger = 0To _My.Computer.Ports.SerialPortNames.Count - 1

cbbCOMPorts.Items.Add( _

My.Computer.Ports.SerialPortNames(i))

cbbCOMPorts.Select(1, 1)

Next


Error still happens atMy.Computer.Portswhich says 'ports' is not a member of my.mycomputer..


I've some problems regarding receiving data from the serial port.

PrivateShared portAs System.IO.Ports.SerialPort =New System.IO.Ports.SerialPort()

'event handler for data_received

PrivateSub OnDataReceived(ByVal senderAsObject, _

ByVal eAs System.IO.Ports.SerialDataReceivedEventArgs) _

Handles port.DataReceived

1)At port.DataReceived, the port has an error which says port handles clause requires a WithEvents variable defined in the containing type of one of its base type

Try

TextBox1.Invoke(New myDelegate(AddressOf UpdateTextBox),NewObject() {})

Catch exAs Exception

MsgBox(ex.Message)

EndTry

EndSub

2)TextBox1.Invoke, error occurs which says 'invoke' is not a member of 'system.Web.UI,webcontrols.textbox'.


I imagine that you've probably solved this, but for anyone else who's searching (i've done this so many times myself), i think you need to set the line

PrivateSharedWithEvents portAs System.IO.Ports.SerialPort

HTH.


Yes if you are going the event driven route. I am not sure I did that in the app I built last year. I think I tried, but the device I was reading did not like that method.Big Smile

Tuesday, March 13, 2012

server application unavailable

hi,
while browsing the asp.net application,i am getting server application unavailable error.in the application log the below msg is there

aspnet_wp.exe could not be started. The error code for the failure is 80004005. This error can be caused when the worker process account has insufficient rights to read the .NET Framework files. Please ensure that the .NET Framework is correctly installed and that the ACLs on the installation directory allow access to the configured account.

plz give me suggestion to rectify the problemHi,

apparently the aspnet user account doesn't have enough privileges to access certain folders. When you type in the exact error in google then you get several hits on the error and how to solve them.

My first thing would be to just reinstall the .NET framework.

Grz, Kris.