Using Missing.Value in C#

  • Thread starter Thread starter DN
  • Start date Start date
D

DN

Is it possible to use Missing.Value in C#, or is that just a VB
concept?

I'm using Persits ASPEmail component in an ASP.NET page, and their
sample code shows something like this:

<%@ Page language="C#" %>
<%@ import namespace=AspEmail %>
<%@ Import Namespace="System.Reflection" %>
<%
AspEmail.MailSenderClass myMail = new AspEmail.MailSenderClass();
myMail.AddAddress(Request.QueryString["email"].Trim(), "");
...other properties set...
myMail.Send(Missing.Value);
%>

The myMail.Send line always gives "System.NullReferenceException:
Object reference not set to an instance of an object" no matter what I
pass in.

I'm starting to think the way I tlbimp'd the DLL must have been wrong,
but
there just aren't that many options? What else could I be doing
wrong??

Thanks in advance for any ideas.
D
 
Forget about the ASPemail component and use the System.Web.Mail namespace
provided with .NET

I was minding my own business when DN blurted out:
Is it possible to use Missing.Value in C#, or is that just a VB
concept?

I'm using Persits ASPEmail component in an ASP.NET page, and their
sample code shows something like this:

<%@ Page language="C#" %>
<%@ import namespace=AspEmail %>
<%@ Import Namespace="System.Reflection" %>
<%
AspEmail.MailSenderClass myMail = new AspEmail.MailSenderClass();
myMail.AddAddress(Request.QueryString["email"].Trim(), "");
...other properties set...
myMail.Send(Missing.Value);
%>

The myMail.Send line always gives "System.NullReferenceException:
Object reference not set to an instance of an object" no matter what I
pass in.

I'm starting to think the way I tlbimp'd the DLL must have been wrong,
but
there just aren't that many options? What else could I be doing
wrong??

Thanks in advance for any ideas.
D
 
I'd love to use the built in one, but I really need to add an
attachment to the message that comes from an in-memory buffer.
Persits ASPEmail is the only one I've found that can do that (the rest
require a path to a file, and I can't write to the file system).

Any other ideas??


-=Chris=- said:
Forget about the ASPemail component and use the System.Web.Mail namespace
provided with .NET

I was minding my own business when DN blurted out:
Is it possible to use Missing.Value in C#, or is that just a VB
concept?

I'm using Persits ASPEmail component in an ASP.NET page, and their
sample code shows something like this:

<%@ Page language="C#" %>
<%@ import namespace=AspEmail %>
<%@ Import Namespace="System.Reflection" %>
<%
AspEmail.MailSenderClass myMail = new AspEmail.MailSenderClass();
myMail.AddAddress(Request.QueryString["email"].Trim(), "");
...other properties set...
myMail.Send(Missing.Value);
%>

The myMail.Send line always gives "System.NullReferenceException:
Object reference not set to an instance of an object" no matter what I
pass in.

I'm starting to think the way I tlbimp'd the DLL must have been wrong,
but
there just aren't that many options? What else could I be doing
wrong??

Thanks in advance for any ideas.
D
 
Back
Top