Thursday, March 29, 2012
MailMessage HTML body - Please Help Urgent
I am having problem sending email to external mailbox using HTML format.
Following is a simplified code that I used to send the email.
Dim myMsg As New MailMessage
Dim htmlBody As String
htmlBody = "<HTML><BODY><A
HREF='http://www.microsoft.com'>Microsoft</A></BODY></HTML>"
myMsg.From = "me@dotnet.itags.org.domain.com"
myMsg.To = "friend@dotnet.itags.org.yourdomain.com"
myMsg.Subject = "Testing HTML"
myMsg.BodyFormat = MailFormat.Html
myMsg.Body = htmlBody
System.Web.Mail.SmtpMail.SmtpServer = "smtpserver.domain.com"
System.Web.Mail.SmtpMail.Send(myMsg)
My SMTP server is an Exchange 2003 server with SP2. When using the same
code to send email to internal mailbox (with our Exchange Organization), the
HTML format was retained. However when email was sent out to external
mailbox (e.g. hotmail, yahoo, gmail), it was converted to plain text. I had
tried using Outlook to send email using HTML format to external mailbox and
it remains as HTML format.
Hope that someone can enlighten me.
Thanks In Advance,
AlexYou don't need to put the HTML tag as a page. Do this and should work:
htmlBody = "<A HREF='http://www.microsoft.com'>Microsoft</A><BR>"
Cheers
Al
"Yukon@.nospam.nospam" wrote:
> Hi,
> I am having problem sending email to external mailbox using HTML format.
> Following is a simplified code that I used to send the email.
> Dim myMsg As New MailMessage
> Dim htmlBody As String
> htmlBody = "<HTML><BODY><A
> HREF='http://www.microsoft.com'>Microsoft</A></BODY></HTML>"
> myMsg.From = "me@.domain.com"
> myMsg.To = "friend@.yourdomain.com"
> myMsg.Subject = "Testing HTML"
> myMsg.BodyFormat = MailFormat.Html
> myMsg.Body = htmlBody
> System.Web.Mail.SmtpMail.SmtpServer = "smtpserver.domain.com"
> System.Web.Mail.SmtpMail.Send(myMsg)
> My SMTP server is an Exchange 2003 server with SP2. When using the same
> code to send email to internal mailbox (with our Exchange Organization), t
he
> HTML format was retained. However when email was sent out to external
> mailbox (e.g. hotmail, yahoo, gmail), it was converted to plain text. I h
ad
> tried using Outlook to send email using HTML format to external mailbox an
d
> it remains as HTML format.
> Hope that someone can enlighten me.
>
> Thanks In Advance,
> Alex
>
>
Hi Al,
I had tried that and it still get converted to plain text.
Thanks,
Alex
"Albert Pascual" <AlbertPascual@.discussions.microsoft.com> wrote in message
news:1F49F255-72D5-4E9E-BDA0-DA5FE449D4C5@.microsoft.com...
> You don't need to put the HTML tag as a page. Do this and should work:
> htmlBody = "<A HREF='http://www.microsoft.com'>Microsoft</A><BR>"
> Cheers
> Al
>
> "Yukon@.nospam.nospam" wrote:
>
MailMessage Problem
but I get the error " The specified string is not in the form required for
an e-mail address." when the "Dim Mailmsg..." line is executed. Since I
haven't defined the from/to yet, I don't understand what it wants? Any
insight on what causes this?
=========================================
Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
Dim Mailmsg As New System.Net.Mail.MailMessage
Mailmsg.To.Clear()
Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name
<toname@dotnet.itags.org.todomain.com>")
Mailmsg.From = New System.Net.Mail.MailAddress("From Name
<fromname@dotnet.itags.org.yourfromdomain.com>")
Mailmsg.Subject = "(subject text)"
Try
Mailmsg.Body = "(message text here)"
obj.Send(Mailmsg)
Catch ex As Exception
Response.Write("Error: " & ex.ToString())
End Try
=========================================re:
> Since I haven't defined the from/to yet
Actually, you *have* defined it, as :
Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name <toname@.todomain.com>")
Mailmsg.From = New System.Net.Mail.MailAddress("From Name <fromname@.yourfromdomain.com>")
It's expecting a mail address in the form :
new MailAddress("somebody@.somewhere.com", "Some Name");
Try :
Mailmsg.To.Add(New System.Net.Mail.MailAddress("toname@.todomain.com", "To Name")
Mailmsg.From = New System.Net.Mail.MailAddress("fromname@.yourfromdomain.com", "From Name")
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
> Using the code below, I am trying to send an email from an ASP.NET 2.0 page but I get the error "
> The specified string is not in the form required for an e-mail address." when the "Dim Mailmsg..."
> line is executed. Since I haven't defined the from/to yet, I don't understand what it wants? Any
> insight on what causes this?
>
> =========================================
> Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
> Dim Mailmsg As New System.Net.Mail.MailMessage
> Mailmsg.To.Clear()
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name <toname@.todomain.com>")
> Mailmsg.From = New System.Net.Mail.MailAddress("From Name <fromname@.yourfromdomain.com>")
> Mailmsg.Subject = "(subject text)"
> Try
> Mailmsg.Body = "(message text here)"
> obj.Send(Mailmsg)
> Catch ex As Exception
> Response.Write("Error: " & ex.ToString())
> End Try
> =========================================
I hsould have added...
See http://msdn2.microsoft.com/en-us/li...ailaddress.aspx
and http://msdn2.microsoft.com/en-us/li...fkf(VS.80).aspx
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uzKgxteRGHA.4960@.TK2MSFTNGP12.phx.gbl...
> re:
>> Since I haven't defined the from/to yet
> Actually, you *have* defined it, as :
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name <toname@.todomain.com>")
> Mailmsg.From = New System.Net.Mail.MailAddress("From Name <fromname@.yourfromdomain.com>")
> It's expecting a mail address in the form :
> new MailAddress("somebody@.somewhere.com", "Some Name");
> Try :
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("toname@.todomain.com", "To Name")
> Mailmsg.From = New System.Net.Mail.MailAddress("fromname@.yourfromdomain.com", "From Name")
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ===================================
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
>> Using the code below, I am trying to send an email from an ASP.NET 2.0 page but I get the error "
>> The specified string is not in the form required for an e-mail address." when the "Dim
>> Mailmsg..." line is executed. Since I haven't defined the from/to yet, I don't understand what it
>> wants? Any insight on what causes this?
>>
>>
>> =========================================
>> Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
>> Dim Mailmsg As New System.Net.Mail.MailMessage
>> Mailmsg.To.Clear()
>> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name <toname@.todomain.com>")
>> Mailmsg.From = New System.Net.Mail.MailAddress("From Name <fromname@.yourfromdomain.com>")
>> Mailmsg.Subject = "(subject text)"
>> Try
>> Mailmsg.Body = "(message text here)"
>> obj.Send(Mailmsg)
>> Catch ex As Exception
>> Response.Write("Error: " & ex.ToString())
>> End Try
>> =========================================
>>
I'm confused. The error occurs on the "Dim Mailmsg..." before the To and
From addresses are set?
Wayne
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uzKgxteRGHA.4960@.TK2MSFTNGP12.phx.gbl...
> re:
>> Since I haven't defined the from/to yet
> Actually, you *have* defined it, as :
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name
> <toname@.todomain.com>")
> Mailmsg.From = New System.Net.Mail.MailAddress("From Name
> <fromname@.yourfromdomain.com>")
> It's expecting a mail address in the form :
> new MailAddress("somebody@.somewhere.com", "Some Name");
> Try :
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("toname@.todomain.com", "To
> Name")
> Mailmsg.From = New
> System.Net.Mail.MailAddress("fromname@.yourfromdomain.com", "From Name")
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ===================================
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
>> Using the code below, I am trying to send an email from an ASP.NET 2.0
>> page but I get the error " The specified string is not in the form
>> required for an e-mail address." when the "Dim Mailmsg..." line is
>> executed. Since I haven't defined the from/to yet, I don't understand
>> what it wants? Any insight on what causes this?
>>
>>
>> =========================================
>> Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
>> Dim Mailmsg As New System.Net.Mail.MailMessage
>> Mailmsg.To.Clear()
>> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name
>> <toname@.todomain.com>")
>> Mailmsg.From = New System.Net.Mail.MailAddress("From Name
>> <fromname@.yourfromdomain.com>")
>> Mailmsg.Subject = "(subject text)"
>> Try
>> Mailmsg.Body = "(message text here)"
>> obj.Send(Mailmsg)
>> Catch ex As Exception
>> Response.Write("Error: " & ex.ToString())
>> End Try
>> =========================================
>>
Sure, that's standard OOP procedure.
When you call an object, all of its components are called, too.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:uagy1xfRGHA.1608@.TK2MSFTNGP09.phx.gbl...
> I'm confused. The error occurs on the "Dim Mailmsg..." before the To and From addresses are set?
> Wayne
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uzKgxteRGHA.4960@.TK2MSFTNGP12.phx.gbl...
>> re:
>>> Since I haven't defined the from/to yet
>>
>> Actually, you *have* defined it, as :
>>
>> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name <toname@.todomain.com>")
>> Mailmsg.From = New System.Net.Mail.MailAddress("From Name <fromname@.yourfromdomain.com>")
>>
>> It's expecting a mail address in the form :
>>
>> new MailAddress("somebody@.somewhere.com", "Some Name");
>>
>> Try :
>>
>> Mailmsg.To.Add(New System.Net.Mail.MailAddress("toname@.todomain.com", "To Name")
>> Mailmsg.From = New System.Net.Mail.MailAddress("fromname@.yourfromdomain.com", "From Name")
>>
>>
>>
>>
>> Juan T. Llibre, asp.net MVP
>> aspnetfaq.com : http://www.aspnetfaq.com/
>> asp.net faq : http://asp.net.do/faq/
>> foros de asp.net, en espaol : http://asp.net.do/foros/
>> ===================================
>> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
>> news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
>>> Using the code below, I am trying to send an email from an ASP.NET 2.0 page but I get the error
>>> " The specified string is not in the form required for an e-mail address." when the "Dim
>>> Mailmsg..." line is executed. Since I haven't defined the from/to yet, I don't understand what
>>> it wants? Any insight on what causes this?
>>>
>>>
>>> =========================================
>>> Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
>>> Dim Mailmsg As New System.Net.Mail.MailMessage
>>> Mailmsg.To.Clear()
>>> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name <toname@.todomain.com>")
>>> Mailmsg.From = New System.Net.Mail.MailAddress("From Name <fromname@.yourfromdomain.com>")
>>> Mailmsg.Subject = "(subject text)"
>>> Try
>>> Mailmsg.Body = "(message text here)"
>>> obj.Send(Mailmsg)
>>> Catch ex As Exception
>>> Response.Write("Error: " & ex.ToString())
>>> End Try
>>> =========================================
>>>
>>
>>
I have 2.0 example mail code at my blog.
with several different authentication options.
http://spaces.msn.com/sholliday
2/8/2006 entry
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
> Using the code below, I am trying to send an email from an ASP.NET 2.0
page
> but I get the error " The specified string is not in the form required for
> an e-mail address." when the "Dim Mailmsg..." line is executed. Since I
> haven't defined the from/to yet, I don't understand what it wants? Any
> insight on what causes this?
>
> =========================================
> Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
> Dim Mailmsg As New System.Net.Mail.MailMessage
> Mailmsg.To.Clear()
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name
> <toname@.todomain.com>")
> Mailmsg.From = New System.Net.Mail.MailAddress("From Name
> <fromname@.yourfromdomain.com>")
> Mailmsg.Subject = "(subject text)"
> Try
> Mailmsg.Body = "(message text here)"
> obj.Send(Mailmsg)
> Catch ex As Exception
> Response.Write("Error: " & ex.ToString())
> End Try
> =========================================
Sloan;
Thanks for that response - You pointed me in what I am sure is the right
direction. I am trying to get the web.config settings right for my
environment (Comcast). It seems that comcast does not require authorization
but there must be something else I overlooked as I am getting the following
error;
Mailbox unavailable. The server response was: [PERMFAIL] comcast.net
requires valid sender domain
I am not sure exactly what it wants - I did try my comcast login and PW but
that had no effect?
Wayne
"sloan" <sloan@.ipass.net> wrote in message
news:ONtKcJgRGHA.252@.TK2MSFTNGP10.phx.gbl...
>I have 2.0 example mail code at my blog.
> with several different authentication options.
> http://spaces.msn.com/sholliday
> 2/8/2006 entry
>
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
>> Using the code below, I am trying to send an email from an ASP.NET 2.0
> page
>> but I get the error " The specified string is not in the form required
>> for
>> an e-mail address." when the "Dim Mailmsg..." line is executed. Since I
>> haven't defined the from/to yet, I don't understand what it wants? Any
>> insight on what causes this?
>>
>>
>> =========================================
>> Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
>> Dim Mailmsg As New System.Net.Mail.MailMessage
>> Mailmsg.To.Clear()
>> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name
>> <toname@.todomain.com>")
>> Mailmsg.From = New System.Net.Mail.MailAddress("From Name
>> <fromname@.yourfromdomain.com>")
>> Mailmsg.Subject = "(subject text)"
>> Try
>> Mailmsg.Body = "(message text here)"
>> obj.Send(Mailmsg)
>> Catch ex As Exception
>> Response.Write("Error: " & ex.ToString())
>> End Try
>> =========================================
>>
>>
I got it working. That last problem was caused by my use of a domain that
had not been activated yet in the From address.
Wayne
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:emOj$4iRGHA.2536@.tk2msftngp13.phx.gbl...
> Sloan;
> Thanks for that response - You pointed me in what I am sure is the right
> direction. I am trying to get the web.config settings right for my
> environment (Comcast). It seems that comcast does not require
> authorization but there must be something else I overlooked as I am
> getting the following error;
> Mailbox unavailable. The server response was: [PERMFAIL] comcast.net
> requires valid sender domain
> I am not sure exactly what it wants - I did try my comcast login and PW
> but that had no effect?
> Wayne
>
> "sloan" <sloan@.ipass.net> wrote in message
> news:ONtKcJgRGHA.252@.TK2MSFTNGP10.phx.gbl...
>>I have 2.0 example mail code at my blog.
>>
>> with several different authentication options.
>>
>> http://spaces.msn.com/sholliday
>>
>> 2/8/2006 entry
>>
>>
>> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
>> news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
>>> Using the code below, I am trying to send an email from an ASP.NET 2.0
>> page
>>> but I get the error " The specified string is not in the form required
>>> for
>>> an e-mail address." when the "Dim Mailmsg..." line is executed. Since I
>>> haven't defined the from/to yet, I don't understand what it wants? Any
>>> insight on what causes this?
>>>
>>>
>>> =========================================
>>> Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
>>> Dim Mailmsg As New System.Net.Mail.MailMessage
>>> Mailmsg.To.Clear()
>>> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name
>>> <toname@.todomain.com>")
>>> Mailmsg.From = New System.Net.Mail.MailAddress("From Name
>>> <fromname@.yourfromdomain.com>")
>>> Mailmsg.Subject = "(subject text)"
>>> Try
>>> Mailmsg.Body = "(message text here)"
>>> obj.Send(Mailmsg)
>>> Catch ex As Exception
>>> Response.Write("Error: " & ex.ToString())
>>> End Try
>>> =========================================
>>>
>>>
>>
>>
MailMessage Problem
but I get the error " The specified string is not in the form required for
an e-mail address." when the "Dim Mailmsg..." line is executed. Since I
haven't defined the from/to yet, I don't understand what it wants? Any
insight on what causes this?
========================================
=
Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
Dim Mailmsg As New System.Net.Mail.MailMessage
Mailmsg.To.Clear()
Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name
<toname@dotnet.itags.org.todomain.com>")
Mailmsg.From = New System.Net.Mail.MailAddress("From Name
<fromname@dotnet.itags.org.yourfromdomain.com>")
Mailmsg.Subject = "(subject text)"
Try
Mailmsg.Body = "(message text here)"
obj.Send(Mailmsg)
Catch ex As Exception
Response.Write("Error: " & ex.ToString())
End Try
========================================
=re:
> Since I haven't defined the from/to yet
Actually, you *have* defined it, as :
Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name <toname@.todomain.com
>")
Mailmsg.From = New System.Net.Mail.MailAddress("From Name <fromname@.yourfrom
domain.com>")
It's expecting a mail address in the form :
new MailAddress("somebody@.somewhere.com", "Some Name");
Try :
Mailmsg.To.Add(New System.Net.Mail.MailAddress("toname@.todomain.com", "To Na
me")
Mailmsg.From = New System.Net.Mail.MailAddress("fromname@.yourfromdomain.com"
, "From Name")
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
> Using the code below, I am trying to send an email from an ASP.NET 2.0 pag
e but I get the error "
> The specified string is not in the form required for an e-mail address." w
hen the "Dim Mailmsg..."
> line is executed. Since I haven't defined the from/to yet, I don't underst
and what it wants? Any
> insight on what causes this?
>
> ========================================
=
> Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
> Dim Mailmsg As New System.Net.Mail.MailMessage
> Mailmsg.To.Clear()
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name <toname@.todomain.c
om>")
> Mailmsg.From = New System.Net.Mail.MailAddress("From Name <fromname@.yourfr
omdomain.com>")
> Mailmsg.Subject = "(subject text)"
> Try
> Mailmsg.Body = "(message text here)"
> obj.Send(Mailmsg)
> Catch ex As Exception
> Response.Write("Error: " & ex.ToString())
> End Try
> ========================================
=
>
I hsould have added...
See http://msdn2.microsoft.com/en-us/li...ibrary/1s17zfkf(VS.80).aspx
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uzKgxteRGHA.4960@.TK2MSFTNGP12.phx.gbl...
> re:
> Actually, you *have* defined it, as :
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name <toname@.todomain.c
om>")
> Mailmsg.From = New System.Net.Mail.MailAddress("From Name <fromname@.yourfr
omdomain.com>")
> It's expecting a mail address in the form :
> new MailAddress("somebody@.somewhere.com", "Some Name");
> Try :
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("toname@.todomain.com", "To
Name")
> Mailmsg.From = New System.Net.Mail.MailAddress("fromname@.yourfromdomain.co
m", "From Name")
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ===================================
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
>
I'm
. The error occurs on the "Dim Mailmsg..." before the To andFrom addresses are set?
Wayne
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uzKgxteRGHA.4960@.TK2MSFTNGP12.phx.gbl...
> re:
> Actually, you *have* defined it, as :
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name
> <toname@.todomain.com>")
> Mailmsg.From = New System.Net.Mail.MailAddress("From Name
> <fromname@.yourfromdomain.com>")
> It's expecting a mail address in the form :
> new MailAddress("somebody@.somewhere.com", "Some Name");
> Try :
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("toname@.todomain.com", "To
> Name")
> Mailmsg.From = New
> System.Net.Mail.MailAddress("fromname@.yourfromdomain.com", "From Name")
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ===================================
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
>
Sure, that's standard OOP procedure.
When you call an object, all of its components are called, too.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:uagy1xfRGHA.1608@.TK2MSFTNGP09.phx.gbl...
> I'm
. The error occurs on the "Dim Mailmsg..." before the To and From addresses are set?
> Wayne
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uzKgxteRGHA.4960@.TK2MSFTNGP12.phx.gbl...
>
I have 2.0 example mail code at my blog.
with several different authentication options.
http://spaces.msn.com/sholliday
2/8/2006 entry
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
> Using the code below, I am trying to send an email from an ASP.NET 2.0
page
> but I get the error " The specified string is not in the form required for
> an e-mail address." when the "Dim Mailmsg..." line is executed. Since I
> haven't defined the from/to yet, I don't understand what it wants? Any
> insight on what causes this?
>
> ========================================
=
> Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
> Dim Mailmsg As New System.Net.Mail.MailMessage
> Mailmsg.To.Clear()
> Mailmsg.To.Add(New System.Net.Mail.MailAddress("To Name
> <toname@.todomain.com>")
> Mailmsg.From = New System.Net.Mail.MailAddress("From Name
> <fromname@.yourfromdomain.com>")
> Mailmsg.Subject = "(subject text)"
> Try
> Mailmsg.Body = "(message text here)"
> obj.Send(Mailmsg)
> Catch ex As Exception
> Response.Write("Error: " & ex.ToString())
> End Try
> ========================================
=
>
Sloan;
Thanks for that response - You pointed me in what I am sure is the right
direction. I am trying to get the web.config settings right for my
environment (Comcast). It seems that comcast does not require authorization
but there must be something else I overlooked as I am getting the following
error;
Mailbox unavailable. The server response was: [PERMFAIL] comcast.net
requires valid sender domain
I am not sure exactly what it wants - I did try my comcast login and PW but
that had no effect?
Wayne
"sloan" <sloan@.ipass.net> wrote in message
news:ONtKcJgRGHA.252@.TK2MSFTNGP10.phx.gbl...
>I have 2.0 example mail code at my blog.
> with several different authentication options.
> http://spaces.msn.com/sholliday
> 2/8/2006 entry
>
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:%233LbeOeRGHA.1204@.TK2MSFTNGP12.phx.gbl...
> page
>
I got it working. That last problem was caused by my use of a domain that
had not been activated yet in the From address.
Wayne
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:emOj$4iRGHA.2536@.tk2msftngp13.phx.gbl...
> Sloan;
> Thanks for that response - You pointed me in what I am sure is the right
> direction. I am trying to get the web.config settings right for my
> environment (Comcast). It seems that comcast does not require
> authorization but there must be something else I overlooked as I am
> getting the following error;
> Mailbox unavailable. The server response was: [PERMFAIL] comcast.net
> requires valid sender domain
> I am not sure exactly what it wants - I did try my comcast login and PW
> but that had no effect?
> Wayne
>
> "sloan" <sloan@.ipass.net> wrote in message
> news:ONtKcJgRGHA.252@.TK2MSFTNGP10.phx.gbl...
>
MailMessage Question
strMessage = "Message Text";MailMessage objMailMessage = new MailMessage();
objMailMessage.From = txtEmail.Text;
objMailMessage.Subject = "Maytag Contact Information";
objMailMessage.To = "mindreactor@dotnet.itags.org.gish.com";
objMailMessage.Body = strMessage;
objMailMessage.Priority = MailPriority.High;SmtpMail.Send(objMailMessage);
Of course it works great but when I change the .To to the proper address, it doesn't take it... do I have to recompile something or other, destroy the MailMessage Object, what? IT works fine on my test server and when I upload to the main server works fine too... its just when I change the To and reupload, still sends to the old address...
any help would be appreciated...
AarronOnce you made any changes you need to recompile it again.
Hope it helps !!
Okay, total newbie question then...
but I also assumd VS handled all of the recompilation before hand... is the Build option what recompiles?
Thanks,
Aarron
yup the build option or offcourse the rebuild option
as a general rule of thumb ive found with vs.net- if you change soemthing in the design, in the .aspx page, you can just save and you will be fine, but if you change somehting in any of the code or code-behind, like the .cs or .aspx.cs, you have to rebuild
MailMessage question
I have a doubt about the "MailMessage" class in Framework .NET 1.1.
My SMTP server works in a local network that no have access to the internet
for security reasons. And in my network we have an application that send
emails to other department inside the company using us SMTP server that
requires authentication...
I'd like to know why when I use the "MailMessage" Class with "SMTPServer"
class to authenticate in my SMTP Server I have to send an URL as
"http://schemas.microsoft.com/cdo/configuration/"; to authenticate. Is it the
unique mode to send emails in my situation? What's the other mode to send
emails without pass by Microsoft's URL?
Thanks,
--
MSG Servicos de Informatica
Rio de Janeiro / Brazil=?Utf-8?B?TVNHIFNlcnZpY29zIGRlIEluZm9ybWF0aWNh?=
<message@.newsgroup.nospam> wrote in
news:B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com:
> I'd like to know why when I use the "MailMessage" Class with
> "SMTPServer"
> class to authenticate in my SMTP Server I have to send an URL as
> "http://schemas.microsoft.com/cdo/configuration/"; to authenticate. Is
> it the unique mode to send emails in my situation? What's the other
> mode to send emails without pass by Microsoft's URL?
You'll need to be using .NET 1.1 to use these fields.
With the System.Web.Mail classes, you'll have to pass in these fields,
since authentication is not supported out of the box.
You might want to take a look at the field:
http://schemas.microsoft.com/cdo/co...ation/sendusing
0 is basic. 1 is NTML. 2 is SMTP authentication.
--
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Thanks for Lucas's inputs,
Hi Friend,
For the "http://schemas.microsoft.com/cdo/configuration/ " , it's not a
normal URL, it's a configuration URI(maybe we should say it's a key for
configuring certain setting of the CDO object):
#http://schemas.microsoft.com/cdo/configuration/ Namespace
http://msdn.microsoft.com/library/e...a_configuration.
asp?frame=true
In fact, the System.Web.Mail components in .net framework is using the CDO
object underlying. And the
http://schemas.microsoft.com/cdo/configuration/ contains a collection of
schema URIs( keys) to identify a set of settings of the CDO component , we
can configure them thorugh these URIs at runtime.
BTW, here is a FAQ site of System.Web.Mail which contains may common
question on the web mail components:
http://www.systemwebmail.com/
Hope also helps. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
-------
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: MailMessage question
| From: Lucas Tam <REMOVEnntp@.rogers.com>
| References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
| Organization: None of Your Business!!!
| Message-ID: <Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
| User-Agent: Xnews/??.01.30
| X-Face:
#gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xT bMCCP
'rF/EnVDK-y*a(Qh3J)+Fn]"/&@.D(dOG=ITH!\afBA$O}D";gSvoEpfd
| Reply-To: REMOVEnntp@.rogers.com
| Lines: 25
| X-Complaints-To: abuse@.easynews.com
| X-Complaints-Info: Please be sure to forward a copy of ALL headers
otherwise we will be unable to process your complaint properly.
| Date: Thu, 11 Aug 2005 15:11:22 GMT
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornad o.fastwebnet.it!tiscali!ne
wsfeed1.ip.tiscali.net!news.glorb.com!newsfeed2.ea synews.com!easynews.com!ea
synews!easynews-local!fe04.news.easynews.com.POSTED!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:117418
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| =?Utf-8?B?TVNHIFNlcnZpY29zIGRlIEluZm9ybWF0aWNh?=
| <message@.newsgroup.nospam> wrote in
| news:B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com:
|
| > I'd like to know why when I use the "MailMessage" Class with
| > "SMTPServer"
| > class to authenticate in my SMTP Server I have to send an URL as
| > "http://schemas.microsoft.com/cdo/configuration/"; to authenticate. Is
| > it the unique mode to send emails in my situation? What's the other
| > mode to send emails without pass by Microsoft's URL?
|
| You'll need to be using .NET 1.1 to use these fields.
|
| With the System.Web.Mail classes, you'll have to pass in these fields,
| since authentication is not supported out of the box.
|
| You might want to take a look at the field:
| http://schemas.microsoft.com/cdo/co...ation/sendusing
|
| 0 is basic. 1 is NTML. 2 is SMTP authentication.
|
| --
| Lucas Tam (REMOVEnntp@.rogers.com)
| Please delete "REMOVE" from the e-mail address when replying.
| http://members.ebay.com/aboutme/coolspot18/
|
And if I do not have internet connection in my intranet where the
application is running? How would I reach
"http://schemas.microsoft.com/cdo/configuration/" ?
WHAT CAN I DO IN THIS SITUATION??
--
MSG Servicos de Informatica
Rio de Janeiro / Brazil
"Steven Cheng[MSFT]" wrote:
> Thanks for Lucas's inputs,
> Hi Friend,
> For the "http://schemas.microsoft.com/cdo/configuration/ " , it's not a
> normal URL, it's a configuration URI(maybe we should say it's a key for
> configuring certain setting of the CDO object):
> #http://schemas.microsoft.com/cdo/configuration/ Namespace
> http://msdn.microsoft.com/library/e...a_configuration.
> asp?frame=true
> In fact, the System.Web.Mail components in .net framework is using the CDO
> object underlying. And the
> http://schemas.microsoft.com/cdo/configuration/ contains a collection of
> schema URIs( keys) to identify a set of settings of the CDO component , we
> can configure them thorugh these URIs at runtime.
> BTW, here is a FAQ site of System.Web.Mail which contains may common
> question on the web mail components:
> http://www.systemwebmail.com/
> Hope also helps. Thanks,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> -------
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | Subject: Re: MailMessage question
> | From: Lucas Tam <REMOVEnntp@.rogers.com>
> | References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
> | Organization: None of Your Business!!!
> | Message-ID: <Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
> | User-Agent: Xnews/??.01.30
> | X-Face:
> #gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xT bMCCP
> 'rF/EnVDK-y*a(Qh3J)+Fn]"/&@.D(dOG=ITH!\afBA$O}D";gSvoEpfd
> | Reply-To: REMOVEnntp@.rogers.com
> | Lines: 25
> | X-Complaints-To: abuse@.easynews.com
> | X-Complaints-Info: Please be sure to forward a copy of ALL headers
> otherwise we will be unable to process your complaint properly.
> | Date: Thu, 11 Aug 2005 15:11:22 GMT
> | Path:
> TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornad o.fastwebnet.it!tiscali!ne
> wsfeed1.ip.tiscali.net!news.glorb.com!newsfeed2.ea synews.com!easynews.com!ea
> synews!easynews-local!fe04.news.easynews.com.POSTED!not-for-mail
> | Xref: TK2MSFTNGXA01.phx.gbl
> microsoft.public.dotnet.framework.aspnet:117418
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> |
> | =?Utf-8?B?TVNHIFNlcnZpY29zIGRlIEluZm9ybWF0aWNh?=
> | <message@.newsgroup.nospam> wrote in
> | news:B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com:
> |
> | > I'd like to know why when I use the "MailMessage" Class with
> | > "SMTPServer"
> | > class to authenticate in my SMTP Server I have to send an URL as
> | > "http://schemas.microsoft.com/cdo/configuration/"; to authenticate. Is
> | > it the unique mode to send emails in my situation? What's the other
> | > mode to send emails without pass by Microsoft's URL?
> |
> | You'll need to be using .NET 1.1 to use these fields.
> |
> | With the System.Web.Mail classes, you'll have to pass in these fields,
> | since authentication is not supported out of the box.
> |
> | You might want to take a look at the field:
> | http://schemas.microsoft.com/cdo/co...ation/sendusing
> |
> | 0 is basic. 1 is NTML. 2 is SMTP authentication.
> |
> | --
> | Lucas Tam (REMOVEnntp@.rogers.com)
> | Please delete "REMOVE" from the e-mail address when replying.
> | http://members.ebay.com/aboutme/coolspot18/
> |
>
=?Utf-8?B?TVNHIFNlcnZpY29zIGRlIEluZm9ybWF0aWNh?= <message@.newsgroup.nospam>
wrote in news:0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com:
> And if I do not have internet connection in my intranet where the
> application is running? How would I reach
> "http://schemas.microsoft.com/cdo/configuration/" ?
It's an (xml) schema... not an actual URL.
--
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Yes, "http://schemas.microsoft.com/cdo/configuration/" is just a URI (not
necessarily a valid URL on the internet). It is just the same as other keys
such as:
"urn:microsoft-com:mail", "key_microsoft_mail" ....
Using such schema keys dosn't require the box be connected to the internet,
these buildin schema key will be recognized by the certain processing
application. For example, for the
"http://schemas.microsoft.com/cdo/configuration/"
it'll be recoginzed by the CDO components no matter the components is
running on a isolated box or connected to internet.
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
-------
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: MailMessage question
| From: Lucas Tam <REMOVEnntp@.rogers.com>
| References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
<Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
<D$Am$munFHA.3672@.TK2MSFTNGXA01.phx.gbl>
<0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com>
| Organization: None of Your Business!!!
| Message-ID: <Xns96B3D6AE4B9C7nntprogerscom@.127.0.0.1>
| User-Agent: Xnews/??.01.30
| X-Face:
#gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xT bMCCP
'rF/EnVDK-y*a(Qh3J)+Fn]"/&@.D(dOG=ITH!\afBA$O}D";gSvoEpfd
| Reply-To: REMOVEnntp@.rogers.com
| Lines: 13
| X-Complaints-To: abuse@.easynews.com
| X-Complaints-Info: Please be sure to forward a copy of ALL headers
otherwise we will be unable to process your complaint properly.
| Date: Tue, 16 Aug 2005 01:06:16 GMT
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
ne.de!newshub.sdsu.edu!newsfeed.news2me.com!newsfe ed2.easynews.com!easynews.
com!easynews!easynews-local!fe02.news.easynews.com.POSTED!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:118141
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| =?Utf-8?B?TVNHIFNlcnZpY29zIGRlIEluZm9ybWF0aWNh?=
<message@.newsgroup.nospam>
| wrote in news:0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com:
|
| > And if I do not have internet connection in my intranet where the
| > application is running? How would I reach
| > "http://schemas.microsoft.com/cdo/configuration/" ?
|
| It's an (xml) schema... not an actual URL.
|
| --
| Lucas Tam (REMOVEnntp@.rogers.com)
| Please delete "REMOVE" from the e-mail address when replying.
| http://members.ebay.com/aboutme/coolspot18/
|
Thanks for the answer. This solve my question.
--
MSG Servicos de Informatica
Rio de Janeiro / Brazil
"Steven Cheng[MSFT]" wrote:
> Yes, "http://schemas.microsoft.com/cdo/configuration/" is just a URI (not
> necessarily a valid URL on the internet). It is just the same as other keys
> such as:
> "urn:microsoft-com:mail", "key_microsoft_mail" ....
> Using such schema keys dosn't require the box be connected to the internet,
> these buildin schema key will be recognized by the certain processing
> application. For example, for the
> "http://schemas.microsoft.com/cdo/configuration/"
> it'll be recoginzed by the CDO components no matter the components is
> running on a isolated box or connected to internet.
> Thanks,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> -------
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | Subject: Re: MailMessage question
> | From: Lucas Tam <REMOVEnntp@.rogers.com>
> | References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
> <Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
> <D$Am$munFHA.3672@.TK2MSFTNGXA01.phx.gbl>
> <0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com>
> | Organization: None of Your Business!!!
> | Message-ID: <Xns96B3D6AE4B9C7nntprogerscom@.127.0.0.1>
> | User-Agent: Xnews/??.01.30
> | X-Face:
> #gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xT bMCCP
> 'rF/EnVDK-y*a(Qh3J)+Fn]"/&@.D(dOG=ITH!\afBA$O}D";gSvoEpfd
> | Reply-To: REMOVEnntp@.rogers.com
> | Lines: 13
> | X-Complaints-To: abuse@.easynews.com
> | X-Complaints-Info: Please be sure to forward a copy of ALL headers
> otherwise we will be unable to process your complaint properly.
> | Date: Tue, 16 Aug 2005 01:06:16 GMT
> | Path:
> TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
> ne.de!newshub.sdsu.edu!newsfeed.news2me.com!newsfe ed2.easynews.com!easynews.
> com!easynews!easynews-local!fe02.news.easynews.com.POSTED!not-for-mail
> | Xref: TK2MSFTNGXA01.phx.gbl
> microsoft.public.dotnet.framework.aspnet:118141
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> |
> | =?Utf-8?B?TVNHIFNlcnZpY29zIGRlIEluZm9ybWF0aWNh?=
> <message@.newsgroup.nospam>
> | wrote in news:0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com:
> |
> | > And if I do not have internet connection in my intranet where the
> | > application is running? How would I reach
> | > "http://schemas.microsoft.com/cdo/configuration/" ?
> |
> | It's an (xml) schema... not an actual URL.
> |
> | --
> | Lucas Tam (REMOVEnntp@.rogers.com)
> | Please delete "REMOVE" from the e-mail address when replying.
> | http://members.ebay.com/aboutme/coolspot18/
> |
>
You're welcome :-)
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
-------
| Thread-Topic: MailMessage question
| thread-index: AcWjMpWs1bh8rNtUSlmk+cOvinTrPA==
| X-WBNR-Posting-Host: 200.142.104.78
| From: =?Utf-8?B?TVNHIFNlcnZpY29zIGRlIEluZm9ybWF0aWNh?=
<message@.newsgroup.nospam>
| References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
<Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
<D$Am$munFHA.3672@.TK2MSFTNGXA01.phx.gbl>
<0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com>
<Xns96B3D6AE4B9C7nntprogerscom@.127.0.0.1>
<z7kEXPgoFHA.3472@.TK2MSFTNGXA01.phx.gbl>
| Subject: Re: MailMessage question
| Date: Wed, 17 Aug 2005 06:50:10 -0700
| Lines: 80
| Message-ID: <F835ADA2-7CED-46C6-B46A-92E7B320704E@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:118572
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks for the answer. This solve my question.
|
|
| --
| MSG Servicos de Informatica
| Rio de Janeiro / Brazil
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Yes, "http://schemas.microsoft.com/cdo/configuration/" is just a URI
(not
| > necessarily a valid URL on the internet). It is just the same as other
keys
| > such as:
| >
| > "urn:microsoft-com:mail", "key_microsoft_mail" ....
| >
| > Using such schema keys dosn't require the box be connected to the
internet,
| > these buildin schema key will be recognized by the certain processing
| > application. For example, for the
| >
| > "http://schemas.microsoft.com/cdo/configuration/"
| >
| > it'll be recoginzed by the CDO components no matter the components is
| > running on a isolated box or connected to internet.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > -------
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | Subject: Re: MailMessage question
| > | From: Lucas Tam <REMOVEnntp@.rogers.com>
| > | References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
| > <Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
| > <D$Am$munFHA.3672@.TK2MSFTNGXA01.phx.gbl>
| > <0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com>
| > | Organization: None of Your Business!!!
| > | Message-ID: <Xns96B3D6AE4B9C7nntprogerscom@.127.0.0.1>
| > | User-Agent: Xnews/??.01.30
| > | X-Face:
| >
#gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xT bMCCP
| > 'rF/EnVDK-y*a(Qh3J)+Fn]"/&@.D(dOG=ITH!\afBA$O}D";gSvoEpfd
| > | Reply-To: REMOVEnntp@.rogers.com
| > | Lines: 13
| > | X-Complaints-To: abuse@.easynews.com
| > | X-Complaints-Info: Please be sure to forward a copy of ALL headers
| > otherwise we will be unable to process your complaint properly.
| > | Date: Tue, 16 Aug 2005 01:06:16 GMT
| > | Path:
| >
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
| >
ne.de!newshub.sdsu.edu!newsfeed.news2me.com!newsfe ed2.easynews.com!easynews.
| > com!easynews!easynews-local!fe02.news.easynews.com.POSTED!not-for-mail
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:118141
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | =?Utf-8?B?TVNHIFNlcnZpY29zIGRlIEluZm9ybWF0aWNh?=
| > <message@.newsgroup.nospam>
| > | wrote in news:0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com:
| > |
| > | > And if I do not have internet connection in my intranet where the
| > | > application is running? How would I reach
| > | > "http://schemas.microsoft.com/cdo/configuration/" ?
| > |
| > | It's an (xml) schema... not an actual URL.
| > |
| > | --
| > | Lucas Tam (REMOVEnntp@.rogers.com)
| > | Please delete "REMOVE" from the e-mail address when replying.
| > | http://members.ebay.com/aboutme/coolspot18/
| > |
| >
| >
|
MailMessage proof of delivery
verifies that a MailMessage has been received (or read) to
be sent?not consistently or reliably. This is an option the recipient can deny,
otherwise the spammers would be able to validate addy's WAY too easily.
--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"mg" <mg@.theworld.com> wrote in message
news:095c01c3db65$373bed80$a501280a@.phx.gbl...
> Is there any code that will create a return message that
> verifies that a MailMessage has been received (or read) to
> be sent?
MailMessage problems
send mail. I have had mixed results in that it works sometimes and
sometimes it doesn't. I have tried using the IP address to make sure WINS
was not causing problems, but I seem to have the same results.
Does anyone have any suggestions?
Thanks,
BrentUse the Smtp on the webserver. That is what I finally resorted to using.
You can set up access list controls that only the machine itself can send
from it. (stops spammers from using your mail server.)
bill
"Brent Burkart" <Brent.Burkart@.wvmb.com> wrote in message
news:uopIU2AlDHA.1408@.TK2MSFTNGP11.phx.gbl...
> Has anyone else had problems using an Exchange Server as your SMTP server
to
> send mail. I have had mixed results in that it works sometimes and
> sometimes it doesn't. I have tried using the IP address to make sure WINS
> was not causing problems, but I seem to have the same results.
> Does anyone have any suggestions?
> Thanks,
> Brent
MailMessage Problem?????
Any help would be greatly appreciated.
Private Sub sendmail()Dim Message1 As MailMessage = New MailMessage
Dim Message2 As MailMessage = New MailMessage
Dim strTo As String = "email@dotnet.itags.org.email.com"
Dim strTo2 As String = "email2@dotnet.itags.org.email.com"
Dim strBody As String
Dim EmailFile As StringSmtpMail.SmtpServer = ConfigurationSettings.AppSettings("SMTPServer")
Message1.From = ConfigurationSettings.AppSettings("EmailFrom")
Message1.Subject = ConfigurationSettings.AppSettings("EmailSubject")
Message2.From = ConfigurationSettings.AppSettings("EmailFrom")
Message2.Subject = ConfigurationSettings.AppSettings("EmailSubjectInternal")Select Case ddlAttendee.SelectedValue
Case "Exhibitor"
EmailFile = "EMAIL-EXHIBITOR.htm"
Case "Reseller"
EmailFile = "EMAIL-RESELLER.htm"
Case "User with Maintenance"
EmailFile = "EMAIL-USER.htm"
Case "User without Maintenance"
EmailFile = "EMAIL-USER.htm"
Case "Potential User"
EmailFile = "EMAIL-OTHER.htm"
Case "Other"
EmailFile = "EMAIL-OTHER.htm"
Case "Potential Reseller"
EmailFile = "EMAIL-OTHER.htm"End Select
Try
' Create an instance of StreamReader to read from a file.
Dim sr As StreamReader = New StreamReader(HttpContext.Current.Server.MapPath("") + "\" + EmailFile)
Dim line As String
' Read and display the lines from the file until the end
' of the file is reached.
Do
line = sr.ReadLine()
Message1.Body += line
Loop Until line Is Nothing
sr.Close()Message1.Body = Message1.Body.Replace("[firstname]", tbFirstName.Text.Trim())
Message1.To = tbEmail.Text
Message1.BodyFormat = MailFormat.Html'Message2 code
'strSubject = "Registration: " + ddlAttendee.SelectedValue.ToUpper
Select Case ddlAttendee.SelectedValue
Case "User with Maintenance"
Message2.To = strTo2
Case "User without Maintenance"
Message2.To = strTo2
Case "Reseller"
Message2.To = strTo2
Case Else
Message2.To = strTo
End Select
'Message2.To = strTo
Message2.Body = strBody
Message2.BodyFormat = MailFormat.Text
strBody = "Registered for conference as attendee type " & ddlAttendee.SelectedValue.ToUpper & "." & vbCrLf
strBody += "ACCTID: " & tbAcctID.Text & vbCrLf
strBody += "PO Number: " & tbPONum.Text & vbCrLf
strBody += "Company: " & tbCompany.Text & vbCrLf
strBody += "Name: " & tbFirstName.Text & " " & tbLastName.Text & vbCrLf
strBody += "Title: " & tbTitle.Text & vbCrLf
strBody += "Address: " & tbAddress.Text & vbCrLf
strBody += "City ST: " & tbCity.Text & " , " & ddlStates.SelectedValue + " " & tbZip.Text & vbCrLf
strBody += "Country: " & ddlCountries.SelectedValue & vbCrLf
strBody += "Phone: " & tbPhone.Text & vbCrLf
strBody += "Email: " & tbEmail.Text
'End message 2 codeSmtpMail.Send(Message1)
SmtpMail.Send(Message2)
Catch ex As Exception
End TryEnd Sub
With this code the message1 gets sent fine w/o any problems however when message2 is sent the body is always missing even though strBody returns the correct value.
TIA,
StueStue,
Looks to me like you just need to move the strBody definition up above your assignment to the message body. At the time you are assigning the body, it is an empty string .. then you are forming the strBody after you have already assigned an empty string to the message
HTH,
Mike
Thanks Mike. Sometimes you just need another pair of eyes. Cant believe i missed that. O well. Thanks so much for your help.
Stue
MailMessage question
I have a doubt about the "MailMessage" class in Framework .NET 1.1.
My SMTP server works in a local network that no have access to the internet
for security reasons. And in my network we have an application that send
emails to other department inside the company using us SMTP server that
requires authentication...
I'd like to know why when I use the "MailMessage" Class with "SMTPServer"
class to authenticate in my SMTP Server I have to send an URL as
"http://schemas.microsoft.com/cdo/configuration/"; to authenticate. Is it th
e
unique mode to send emails in my situation? What's the other mode to send
emails without pass by Microsoft's URL?
Thanks,
MSG Servicos de Informatica
Rio de Janeiro / Brazilexamnotes
<message@.newsgroup.nospam> wrote in
news:B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com:
> I'd like to know why when I use the "MailMessage" Class with
> "SMTPServer"
> class to authenticate in my SMTP Server I have to send an URL as
> "http://schemas.microsoft.com/cdo/configuration/"; to authenticate. Is
> it the unique mode to send emails in my situation? What's the other
> mode to send emails without pass by Microsoft's URL?
You'll need to be using .NET 1.1 to use these fields.
With the System.Web.Mail classes, you'll have to pass in these fields,
since authentication is not supported out of the box.
You might want to take a look at the field:
http://schemas.microsoft.com/cdo/co...ation/sendusing
0 is basic. 1 is NTML. 2 is SMTP authentication.
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
[url]http://members.ebay.com/aboutme/
spot18/[/url]Thanks for Lucas's inputs,
Hi Friend,
For the "http://schemas.microsoft.com/cdo/configuration/ " , it's not a
normal URL, it's a configuration URI(maybe we should say it's a key for
configuring certain setting of the CDO object):
#http://schemas.microsoft.com/cdo/configuration/ Namespace
http://msdn.microsoft.com/library/e..._configuration.
asp?frame=true
In fact, the System.Web.Mail components in .net framework is using the CDO
object underlying. And the
http://schemas.microsoft.com/cdo/configuration/ contains a collection of
schema URIs( keys) to identify a set of settings of the CDO component , we
can configure them thorugh these URIs at runtime.
BTW, here is a FAQ site of System.Web.Mail which contains may common
question on the web mail components:
http://www.systemwebmail.com/
Hope also helps. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: MailMessage question
| From: Lucas Tam <REMOVEnntp@.rogers.com>
| References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
| Organization: None of Your Business!!!
| Message-ID: <Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
| User-Agent: Xnews/'.01.30
| X-Face:
#gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xTbMCCP
'rF/EnVDK-y*a(Qh3J)+Fn]"/&@.D(dOG=ITH!\afBA$O}D";gSvoEpfd
| Reply-To: REMOVEnntp@.rogers.com
| Lines: 25
| X-Complaints-To: abuse@.easynews.com
| X-Complaints-Info: Please be sure to forward a copy of ALL headers
otherwise we will be unable to process your complaint properly.
| Date: Thu, 11 Aug 2005 15:11:22 GMT
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!ne
wsfeed1.ip.tiscali.net!news.glorb.com!newsfeed2.easynews.com!easynews.com!ea
synews!easynews-local!fe04.news.easynews.com.POSTED!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:117418
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| examnotes
| <message@.newsgroup.nospam> wrote in
| news:B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com:
|
| > I'd like to know why when I use the "MailMessage" Class with
| > "SMTPServer"
| > class to authenticate in my SMTP Server I have to send an URL as
| > "http://schemas.microsoft.com/cdo/configuration/"; to authenticate. Is
| > it the unique mode to send emails in my situation? What's the other
| > mode to send emails without pass by Microsoft's URL?
|
| You'll need to be using .NET 1.1 to use these fields.
|
| With the System.Web.Mail classes, you'll have to pass in these fields,
| since authentication is not supported out of the box.
|
| You might want to take a look at the field:
| http://schemas.microsoft.com/cdo/co...ation/sendusing
|
| 0 is basic. 1 is NTML. 2 is SMTP authentication.
|
| --
| Lucas Tam (REMOVEnntp@.rogers.com)
| Please delete "REMOVE" from the e-mail address when replying.
| [url]http://members.ebay.com/aboutme/
spot18/[/url]|
And if I do not have internet connection in my intranet where the
application is running? How would I reach
"http://schemas.microsoft.com/cdo/configuration/" ?
WHAT CAN I DO IN THIS SITUATION'
MSG Servicos de Informatica
Rio de Janeiro / Brazil
"Steven Cheng[MSFT]" wrote:
> Thanks for Lucas's inputs,
> Hi Friend,
> For the "http://schemas.microsoft.com/cdo/configuration/ " , it's not a
> normal URL, it's a configuration URI(maybe we should say it's a key for
> configuring certain setting of the CDO object):
> #http://schemas.microsoft.com/cdo/configuration/ Namespace
> http://msdn.microsoft.com/library/e.../configuration/ contains a collection o
f
> schema URIs( keys) to identify a set of settings of the CDO component , we
> can configure them thorugh these URIs at runtime.
> BTW, here is a FAQ site of System.Web.Mail which contains may common
> question on the web mail components:
> http://www.systemwebmail.com/
> Hope also helps. Thanks,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> --
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | Subject: Re: MailMessage question
> | From: Lucas Tam <REMOVEnntp@.rogers.com>
> | References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
> | Organization: None of Your Business!!!
> | Message-ID: <Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
> | User-Agent: Xnews/'.01.30
> | X-Face:
> #gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xTbMC
CP
> 'rF/EnVDK-y*a(Qh3J)+Fn]"/&@.D(dOG=ITH!\afBA$O}D";gSvoEpfd
> | Reply-To: REMOVEnntp@.rogers.com
> | Lines: 25
> | X-Complaints-To: abuse@.easynews.com
> | X-Complaints-Info: Please be sure to forward a copy of ALL headers
> otherwise we will be unable to process your complaint properly.
> | Date: Thu, 11 Aug 2005 15:11:22 GMT
> | Path:
> TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!
ne
> wsfeed1.ip.tiscali.net!news.glorb.com!newsfeed2.easynews.com!easynews.com!
ea
> synews!easynews-local!fe04.news.easynews.com.POSTED!not-for-mail
> | Xref: TK2MSFTNGXA01.phx.gbl
> microsoft.public.dotnet.framework.aspnet:117418
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> |
> | examnotes
> | <message@.newsgroup.nospam> wrote in
> | news:B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com:
> |
> | > I'd like to know why when I use the "MailMessage" Class with
> | > "SMTPServer"
> | > class to authenticate in my SMTP Server I have to send an URL as
> | > "http://schemas.microsoft.com/cdo/configuration/"; to authenticate. Is
> | > it the unique mode to send emails in my situation? What's the other
> | > mode to send emails without pass by Microsoft's URL?
> |
> | You'll need to be using .NET 1.1 to use these fields.
> |
> | With the System.Web.Mail classes, you'll have to pass in these fields,
> | since authentication is not supported out of the box.
> |
> | You might want to take a look at the field:
> | http://schemas.microsoft.com/cdo/co...ation/sendusing
> |
> | 0 is basic. 1 is NTML. 2 is SMTP authentication.
> |
> | --
> | Lucas Tam (REMOVEnntp@.rogers.com)
> | Please delete "REMOVE" from the e-mail address when replying.
> | [url]http://members.ebay.com/aboutme/
spot18/[/url]> |
>
examnotes <message@.newsgroup.nospam>
wrote in news:0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com:
> And if I do not have internet connection in my intranet where the
> application is running? How would I reach
> "http://schemas.microsoft.com/cdo/configuration/" ?
It's an (xml) schema... not an actual URL.
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
[url]http://members.ebay.com/aboutme/
spot18/[/url]Yes, "http://schemas.microsoft.com/cdo/configuration/" is just a URI (not
necessarily a valid URL on the internet). It is just the same as other keys
such as:
"urn:microsoft-com:mail", "key_microsoft_mail" ....
Using such schema keys dosn't require the box be connected to the internet,
these buildin schema key will be recognized by the certain processing
application. For example, for the
"http://schemas.microsoft.com/cdo/configuration/"
it'll be recoginzed by the CDO components no matter the components is
running on a isolated box or connected to internet.
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: MailMessage question
| From: Lucas Tam <REMOVEnntp@.rogers.com>
| References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
<Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
<D$Am$munFHA.3672@.TK2MSFTNGXA01.phx.gbl>
<0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com>
| Organization: None of Your Business!!!
| Message-ID: <Xns96B3D6AE4B9C7nntprogerscom@.127.0.0.1>
| User-Agent: Xnews/'.01.30
| X-Face:
#gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xTbMCCP
'rF/EnVDK-y*a(Qh3J)+Fn]"/&@.D(dOG=ITH!\afBA$O}D";gSvoEpfd
| Reply-To: REMOVEnntp@.rogers.com
| Lines: 13
| X-Complaints-To: abuse@.easynews.com
| X-Complaints-Info: Please be sure to forward a copy of ALL headers
otherwise we will be unable to process your complaint properly.
| Date: Tue, 16 Aug 2005 01:06:16 GMT
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!newshub.sdsu.edu!newsfeed.news2me.com!newsfeed2.easynews.com!easynews.
com!easynews!easynews-local!fe02.news.easynews.com.POSTED!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:118141
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| examnotes
<message@.newsgroup.nospam>
| wrote in news:0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com:
|
| > And if I do not have internet connection in my intranet where the
| > application is running? How would I reach
| > "http://schemas.microsoft.com/cdo/configuration/" ?
|
| It's an (xml) schema... not an actual URL.
|
| --
| Lucas Tam (REMOVEnntp@.rogers.com)
| Please delete "REMOVE" from the e-mail address when replying.
| [url]http://members.ebay.com/aboutme/
spot18/[/url]|
Thanks for the answer. This solve my question.
MSG Servicos de Informatica
Rio de Janeiro / Brazil
"Steven Cheng[MSFT]" wrote:
> Yes, "http://schemas.microsoft.com/cdo/configuration/" is just a URI (not
> necessarily a valid URL on the internet). It is just the same as other key
s
> such as:
> "urn:microsoft-com:mail", "key_microsoft_mail" ....
> Using such schema keys dosn't require the box be connected to the internet
,
> these buildin schema key will be recognized by the certain processing
> application. For example, for the
> "http://schemas.microsoft.com/cdo/configuration/"
> it'll be recoginzed by the CDO components no matter the components is
> running on a isolated box or connected to internet.
> Thanks,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> --
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | Subject: Re: MailMessage question
> | From: Lucas Tam <REMOVEnntp@.rogers.com>
> | References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
> <Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
> <D$Am$munFHA.3672@.TK2MSFTNGXA01.phx.gbl>
> <0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com>
> | Organization: None of Your Business!!!
> | Message-ID: <Xns96B3D6AE4B9C7nntprogerscom@.127.0.0.1>
> | User-Agent: Xnews/'.01.30
> | X-Face:
> #gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xTbMC
CP
> 'rF/EnVDK-y*a(Qh3J)+Fn]"/&@.D(dOG=ITH!\afBA$O}D";gSvoEpfd
> | Reply-To: REMOVEnntp@.rogers.com
> | Lines: 13
> | X-Complaints-To: abuse@.easynews.com
> | X-Complaints-Info: Please be sure to forward a copy of ALL headers
> otherwise we will be unable to process your complaint properly.
> | Date: Tue, 16 Aug 2005 01:06:16 GMT
> | Path:
> TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-on
li
> ne.de!newshub.sdsu.edu!newsfeed.news2me.com!newsfeed2.easynews.com!easynew
s.
> com!easynews!easynews-local!fe02.news.easynews.com.POSTED!not-for-mail
> | Xref: TK2MSFTNGXA01.phx.gbl
> microsoft.public.dotnet.framework.aspnet:118141
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> |
> | examnotes
> <message@.newsgroup.nospam>
> | wrote in news:0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com:
> |
> | > And if I do not have internet connection in my intranet where the
> | > application is running? How would I reach
> | > "http://schemas.microsoft.com/cdo/configuration/" ?
> |
> | It's an (xml) schema... not an actual URL.
> |
> | --
> | Lucas Tam (REMOVEnntp@.rogers.com)
> | Please delete "REMOVE" from the e-mail address when replying.
> | [url]http://members.ebay.com/aboutme/
spot18/[/url]> |
>
You're welcome :-)
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--
| Thread-Topic: MailMessage question
| thread-index: AcWjMpWs1bh8rNtUSlmk+cOvinTrPA==
| X-WBNR-Posting-Host: 200.142.104.78
| From: examnotes
<message@.newsgroup.nospam>
| References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
<Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
<D$Am$munFHA.3672@.TK2MSFTNGXA01.phx.gbl>
<0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com>
<Xns96B3D6AE4B9C7nntprogerscom@.127.0.0.1>
<z7kEXPgoFHA.3472@.TK2MSFTNGXA01.phx.gbl>
| Subject: Re: MailMessage question
| Date: Wed, 17 Aug 2005 06:50:10 -0700
| Lines: 80
| Message-ID: <F835ADA2-7CED-46C6-B46A-92E7B320704E@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:118572
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks for the answer. This solve my question.
|
|
| --
| MSG Servicos de Informatica
| Rio de Janeiro / Brazil
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Yes, "http://schemas.microsoft.com/cdo/configuration/" is just a URI
(not
| > necessarily a valid URL on the internet). It is just the same as other
keys
| > such as:
| >
| > "urn:microsoft-com:mail", "key_microsoft_mail" ....
| >
| > Using such schema keys dosn't require the box be connected to the
internet,
| > these buildin schema key will be recognized by the certain processing
| > application. For example, for the
| >
| > "http://schemas.microsoft.com/cdo/configuration/"
| >
| > it'll be recoginzed by the CDO components no matter the components is
| > running on a isolated box or connected to internet.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | Subject: Re: MailMessage question
| > | From: Lucas Tam <REMOVEnntp@.rogers.com>
| > | References: <B1F4512D-EDBC-4DF5-8980-24EAC7C67D86@.microsoft.com>
| > <Xns96AF71D2B206Anntprogerscom@.127.0.0.1>
| > <D$Am$munFHA.3672@.TK2MSFTNGXA01.phx.gbl>
| > <0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com>
| > | Organization: None of Your Business!!!
| > | Message-ID: <Xns96B3D6AE4B9C7nntprogerscom@.127.0.0.1>
| > | User-Agent: Xnews/'.01.30
| > | X-Face:
| >
#gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xTbMCCP
| > 'rF/EnVDK-y*a(Qh3J)+Fn]"/&@.D(dOG=ITH!\afBA$O}D";gSvoEpfd
| > | Reply-To: REMOVEnntp@.rogers.com
| > | Lines: 13
| > | X-Complaints-To: abuse@.easynews.com
| > | X-Complaints-Info: Please be sure to forward a copy of ALL headers
| > otherwise we will be unable to process your complaint properly.
| > | Date: Tue, 16 Aug 2005 01:06:16 GMT
| > | Path:
| >
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
| >
ne.de!newshub.sdsu.edu!newsfeed.news2me.com!newsfeed2.easynews.com!easynews.
| > com!easynews!easynews-local!fe02.news.easynews.com.POSTED!not-for-mail
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:118141
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | examnotes
| > <message@.newsgroup.nospam>
| > | wrote in news:0C72C1F1-F29C-45F9-BE29-C13A8C75E8F3@.microsoft.com:
| > |
| > | > And if I do not have internet connection in my intranet where the
| > | > application is running? How would I reach
| > | > "http://schemas.microsoft.com/cdo/configuration/" ?
| > |
| > | It's an (xml) schema... not an actual URL.
| > |
| > | --
| > | Lucas Tam (REMOVEnntp@.rogers.com)
| > | Please delete "REMOVE" from the e-mail address when replying.
| > | [url]http://members.ebay.com/aboutme/
spot18/[/url]| > |
| >
| >
|
MailMessage Versus SmtpMail
is there a major difference between the 2 ? because the 2 classes seem to do the same thing ..
thanks !pardon me for this dumb question ...
I found myselft what was the difference ... :p
mod can erase this topic ?! Lol
MailMessage Troubles?
Dim Msg as MailMessage = new MailMessage()
Dim MailObj As New SmtpClient("mail.e-crs.com")
Msg.To.add = "register@dotnet.itags.org.e-crs.com"
Msg.From.email = "register@dotnet.itags.org.e-crs.com"
Msg.Subject="Sales Agent Registration Information"
Msg.Body=sMsg
Msg.IsBodyHtml = "False"
MailObj.SmtpServer ="mail.e-crs.com"
MailObj.Send(Msg)
I know there are mistakes in the code above any help would be great.
Here is a C# function to send mail that works. Maybe it will give you ideas if your isin't working.Hope it helps,
Joe
public static void SendEmail(
string from,
string to,
string cc,
string bcc,
string subject,
string messageBody,
bool html,
string priority)
{
MailMessage mail = new System.Web.Mail.MailMessage();
mail.From =from;
mail.To = to;
if(cc.Length > 0)
{
mail.Cc = cc;
}
if(bcc.Length > 0)
{
mail.Bcc = bcc;
}
mail.Subject = subject;
switch(priority)
{
case "High":
mail.Priority = MailPriority.High;
break;
case "Low":
mail.Priority = MailPriority.Low;
break;
case "Normal":
default:
mail.Priority = MailPriority.Normal;
break;
}
if(ConfigurationSettings.AppSettings.Get("SMTPRequiresAuthentication").ToLower() == "true")
{
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", SMTP_AUTHENTICATED);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",ConfigurationSettings.AppSettings.Get("SMTPUser") );
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", ConfigurationSettings.AppSettings.Get("SMTPPassword"));
}
mail.Body = messageBody;
if(html)
{
mail.BodyFormat = MailFormat.Html;
}
else
{
mail.BodyFormat = MailFormat.Text;
}
SmtpMail.SmtpServer = ConfigurationSettings.AppSettings.Get("SMTPServer");
SmtpMail.Send(mail);
}
Hi,
Have a look at these 2 sites. You will have all the information needed to send mails
Sending Mail with .Net 1.1
Sending Mail with .Net 2.0
Thanks
MailMessage.AlternateViews
Does anyone have an example of creating an email message withAlternative Views. I'd like to send an email as text only but with anHTML version if the recipients email client supports HTML emails.
Stephen
http://www.mikepope.com/blog/DisplayBlog.aspx?permalink=1264
MailMessage, SmtpMail, and Hotmail: Why are my messages getting put in Junkmail?
send me email at my Hotmail email address. However, it always ends up in the
Junkmail folder. Even though I check my Junkmail box, I do not want this to
become a problem if I ever use these classes to have email sent to someone
other than myself. What can I do to avoid having the emails marked as Junk?
Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/Hi Nathan,
I have never experienced this. Can you show us some code?
Bernie Yaeger
"Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
news:ebDcSIIZFHA.1040@.TK2MSFTNGP10.phx.gbl...
>I am using the MailMessage and SmtpMail classes to allow users of my site
>to send me email at my Hotmail email address. However, it always ends up in
>the Junkmail folder. Even though I check my Junkmail box, I do not want
>this to become a problem if I ever use these classes to have email sent to
>someone other than myself. What can I do to avoid having the emails marked
>as Junk? Thanks.
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
>
I do not do anything complicated in my code when creating/sending the email,
I just create a new MailMessage, set the properties, and send it. Here is my
code:
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click
If Page.IsValid Then
Dim commentMsg As New Mail.MailMessage
commentMsg.BodyFormat = Mail.MailFormat.Html
commentMsg.From = txtEmail.Text
commentMsg.Subject = "Comments on Life With Nate"
commentMsg.To = "njsokalski@.hotmail.com"
commentMsg.Body = "<h1>My Heading</h1>"
Mail.SmtpMail.SmtpServer = "localhost"
Mail.SmtpMail.Send(commentMsg)
End If
End Sub
When I check my JunkMail box and look at the email, it looks exactly as I
expected it to, so I know that my coding is correct. I just need to know how
to make the message not look like junkmail. Thanks.
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/
"Bernie Yaeger" <berniey@.cherwellinc.com> wrote in message
news:%23QAR8IKZFHA.2128@.TK2MSFTNGP15.phx.gbl...
> Hi Nathan,
> I have never experienced this. Can you show us some code?
> Bernie Yaeger
> "Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
> news:ebDcSIIZFHA.1040@.TK2MSFTNGP10.phx.gbl...
>
Hello, Nathan:
On Sun, 29 May 2005 15:10:30 -0400: you wrote...
NS> I am using the MailMessage and SmtpMail classes to allow users of my
NS> site to send me email at my Hotmail email address. However, it always
NS> ends up in the Junkmail folder. Even though I check my Junkmail box, I
NS> do not want this to become a problem if I ever use these classes to
NS> have email sent to someone other than myself. What can I do to avoid
NS> having the emails marked as Junk? Thanks.
A host may junk any email based on a number of factors including content,
keywords, sender, originating IP, etc. Try sending yourself a more wordy
email avoiding anything that may sound spamish. Also, Hotmail has various
filter levels that could impact on your received email. One of those levels
is exclusive which allows only mail from senders in your addressbook to make
it into INBOX. Your hosting service could be flagged as a potential spam
source, too.
[url]http://www.paul
owski.com/WSH/[/url] for some CDO stuff if you really think it'ssomehow a .NET issue. But I doubt that.
Regards, Paul R. Sadowski [MVP].
A few options
a. Add your address to the hotmail contacts list
b. Add your domain name to the safe list
"Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
news:ebDcSIIZFHA.1040@.TK2MSFTNGP10.phx.gbl...
:I am using the MailMessage and SmtpMail classes to allow users of my site
to
: send me email at my Hotmail email address. However, it always ends up in
the
: Junkmail folder. Even though I check my Junkmail box, I do not want this
to
: become a problem if I ever use these classes to have email sent to someone
: other than myself. What can I do to avoid having the emails marked as
Junk?
: Thanks.
: --
: Nathan Sokalski
: njsokalski@.hotmail.com
: http://www.nathansokalski.com/
:
:
I think you misunderstood my question. I know how to prevent it from going
into my JunkMail box, but when sending a MailMessage to other people
(visitors to my site), how can I prevent it from going into their JunkMail
box?
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/
"...winston" <merlin@.druid9#.com> wrote in message
news:ebCenQNZFHA.3356@.TK2MSFTNGP15.phx.gbl...
>A few options
> a. Add your address to the hotmail contacts list
> b. Add your domain name to the safe list
> "Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
> news:ebDcSIIZFHA.1040@.TK2MSFTNGP10.phx.gbl...
> :I am using the MailMessage and SmtpMail classes to allow users of my site
> to
> : send me email at my Hotmail email address. However, it always ends up in
> the
> : Junkmail folder. Even though I check my Junkmail box, I do not want this
> to
> : become a problem if I ever use these classes to have email sent to
> someone
> : other than myself. What can I do to avoid having the emails marked as
> Junk?
> : Thanks.
> : --
> : Nathan Sokalski
> : njsokalski@.hotmail.com
> : http://www.nathansokalski.com/
> :
> :
>
AFAIK you can't control their mail accounts. They are required to configure
each of their accounts dependent upon their mail client and isp mail options
to ensure delivery to their Inbox.
.winston
"Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
news:uIlMQ0OZFHA.1368@.tk2msftngp13.phx.gbl...
:I think you misunderstood my question. I know how to prevent it from going
: into my JunkMail box, but when sending a MailMessage to other people
: (visitors to my site), how can I prevent it from going into their JunkMail
: box?
: --
: Nathan Sokalski
: njsokalski@.hotmail.com
: http://www.nathansokalski.com/
:
: "...winston" <merlin@.druid9#.com> wrote in message
: news:ebCenQNZFHA.3356@.TK2MSFTNGP15.phx.gbl...
: >A few options
: > a. Add your address to the hotmail contacts list
: > b. Add your domain name to the safe list
: >
: > "Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
: > news:ebDcSIIZFHA.1040@.TK2MSFTNGP10.phx.gbl...
: > :I am using the MailMessage and SmtpMail classes to allow users of my
site
: > to
: > : send me email at my Hotmail email address. However, it always ends up
in
: > the
: > : Junkmail folder. Even though I check my Junkmail box, I do not want
this
: > to
: > : become a problem if I ever use these classes to have email sent to
: > someone
: > : other than myself. What can I do to avoid having the emails marked as
: > Junk?
: > : Thanks.
: > : --
: > : Nathan Sokalski
: > : njsokalski@.hotmail.com
: > : http://www.nathansokalski.com/
: > :
: > :
: >
: >
:
:
MailMessage.BodyEncoding = "utf-8" results in "windows-1252" in mail message
I'm sending an email using UTF-8 encoding (using MailMessage.BodyEncoding). However, when I look at the mail message source, it states "Windows-1252" instead of "utf-8". As a result of this, some characters in the message are malformed.
Is this known behavior? How do I force the encoding to UTF-8?
Hi sandor,
In the beginning, when email was first being used, it was all us-ascii content. To handle different languages and character sets, different encodings must be used. The following example demonstrates sending a non us-ascii email, using the ISO-8859-1 character set as an example. The hardest part of sending non us-ascii email, is to determine the correct character set. For reference, an easy to use character set chart can be found at aspNetEmail's website, here:http://www.aspnetemail.com/charsets.aspx .
The following example demonstrates this technique.
C#
public static void NonAsciiMail()
{
//create the mail message
MailMessage mail = new MailMessage();//set the addresses
mail.From = new MailAddress("me@.mycompany.com");
mail.To.Add("you@.yourcompany.com");//set the content
mail.Subject = "This is an email";//to send non-ascii content, we need to set the encoding that matches the
//string characterset.
//In this example we use the ISO-8859-1 characterset
mail.Body = "this text has some ISO-8859-1 characters: aò??";
mail.BodyEncoding = Encoding.GetEncoding("iso-8859-1");//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);}
VB.NET
Public Sub NonAsciiMail()
'create the mail message
Dim mail As New MailMessage()'set the addresses
mail.From = New MailAddress("me@.mycompany.com")
mail.To.Add("you@.yourcompany.com")'set the content
mail.Subject = "This is an email"'to send non-ascii content, we need to set the encoding that matches the
'string characterset.
'In this example we use the ISO-8859-1 characterset
mail.Body = "this text has some ISO-8859-1 characters: aò??"
mail.BodyEncoding = Encoding.GetEncoding("iso-8859-1")'send the message
Dim smtp As New SmtpClient("127.0.0.1")
smtp.Send(mail)
End Sub 'NonAsciiMail
Thanks.
Hi Jerome
I think you didn't get my question quite right. I know how to set the encoding but the point is that whenever I set it to UTF-8, it ends up as Windows-1252 when I look in the source of the test message I've sent myself.
Sandor.
MailMessage.BodyEncoding
I'm trying to change Encoding of an e-mail I'm sending after user submits
the form.
User can enter some special characters , so I need to send e-mail with
Central European encoding >> windows-1250.
Please help me ...
Thanx, NevenHave you tried:
MailMessage.BodyEncoding = System.Text.Encoding.GetEncoding("windows-1250");
Here is a good alternative:
http://www.quiksoft.com/emdotnet/smtp/
"Neven Klofutar" <neven.klofutar@.public.srce.hr> wrote in message
news:OUj96CRsEHA.3324@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I'm trying to change Encoding of an e-mail I'm sending after user submits
> the form.
> User can enter some special characters , so I need to send e-mail with
> Central European encoding >> windows-1250.
> Please help me ...
> Thanx, Neven
MailMessage.BodyEncoding
I'm trying to change Encoding of an e-mail I'm sending after user submits
the form.
User can enter some special characters , so I need to send e-mail with
Central European encoding >> windows-1250.
Please help me ...
Thanx, NevenHave you tried:
MailMessage.BodyEncoding = System.Text.Encoding.GetEncoding("windows-1250");
Here is a good alternative:
http://www.quiksoft.com/emdotnet/smtp/
"Neven Klofutar" <neven.klofutar@.public.srce.hr> wrote in message
news:OUj96CRsEHA.3324@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I'm trying to change Encoding of an e-mail I'm sending after user submits
> the form.
> User can enter some special characters , so I need to send e-mail with
> Central European encoding >> windows-1250.
> Please help me ...
> Thanx, Neven
>
mailMessage.Priority not working
I have seen on various ASP.NET tutorials that the following line in the auto eMail code should produce a high priority symbol in the message listing in the recipient's eMail program (e.g. Outlook Express):
mailMessage.Priority = MailPriority.High
However, when I try it, I get "Compiler Error Message: BC30451: Name 'MailPriority' is not declared." Where and how do I need to declare it? I give the complete code below:
Dim mailMessage As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
mailMessage.From = "Tests<tests@dotnet.itags.org.mydomain.co.uk>"
mailMessage.To = "RedcarJohn<redcarjohn@dotnet.itags.org.lycos.co.uk>"
mailMessage.Subject = "Testing mail priority setting"
mailMessage.BodyFormat = System.Web.Mail.MailFormat.Html
mailMessage.Priority = MailPriority.High
mailMessage.Body = "<font face='Arial' size='2'>This eMail should have a high priority mark.</font>"
System.Web.Mail.SmtpMail.SmtpServer = "www.myhoster.co.uk"
System.Web.Mail.SmtpMail.Send(mailMessage)
Regards
RedcarJohn
mailMessage.Priority = MailPriority.High
to:
mailMessage.Priority = System.Web.Mail.MailPriority.High
Thanks for your very quick suggestion. I have tried it but it has made no difference. The eMail arrived OK but without the exclamation mark. Any other ideas?
Regards
RedcarJohn
MailMessage.Headers and Content-Type
The following code has been used:
string subject = "Calendar test 3";
MailMessage emailMessage = new MailMessage();
emailMessage.To = <address>
emailMessage.Subject = "my subject";
emailMessage.Headers.Add("Content-Type","text/calendar;method=\"REQUEST\"");
emailMessage.Body=@dotnet.itags.org."BEGIN:VCALENDAR
PRODID:-//ACME/DesktopCalendar//EN
METHOD:REQUEST
VERSION:2.0...<the rest of iCalendar>
";
MailService.Send(emailMessage);
Even though the content-type was specified in Headers collection the
resulting message still contains "text/plain" content-type.
Please help.
VladYou probably need to set the BodyFormat property on your MailMessage
object to get the content-type to what you want.
Example:
MailMessage mail = new MailMessage();
mail.To = <address>
mail.From = <address>
mail.Subject = emailSubject;
mail.BodyFormat = System.Web.Mail.MailFormat.Html;
Hope that helps
http://www.harleyc.com
Vlad wrote:
> We are trying to set MailMessage Content-Type to be text/calendar
> The following code has been used:
> string subject = "Calendar test 3";
> MailMessage emailMessage = new MailMessage();
> emailMessage.To = <address>
> emailMessage.Subject = "my subject";
> emailMessage.Headers.Add("Content-Type","text/calendar;method=\"REQUEST\"");
> emailMessage.Body=@."BEGIN:VCALENDAR
> PRODID:-//ACME/DesktopCalendar//EN
> METHOD:REQUEST
> VERSION:2.0...<the rest of iCalendar>
> ";
> MailService.Send(emailMessage);
> Even though the content-type was specified in Headers collection the
> resulting message still contains "text/plain" content-type.
> Please help.
> Vlad
I dont think it has anything to do with HTML/Plain text. Content-type is
email header--not HTTP header. I tried it anyways just to be safe and got
the same results - plain text.
Still need MSFT help with this!
<guidomuffin@.hotmail.com> wrote in message
news:1145909503.988524.208540@.i39g2000cwa.googlegr oups.com...
> You probably need to set the BodyFormat property on your MailMessage
> object to get the content-type to what you want.
> Example:
> MailMessage mail = new MailMessage();
> mail.To = <address>
> mail.From = <address>
> mail.Subject = emailSubject;
> mail.BodyFormat = System.Web.Mail.MailFormat.Html;
> Hope that helps
> http://www.harleyc.com
>
> Vlad wrote:
>> We are trying to set MailMessage Content-Type to be text/calendar
>> The following code has been used:
>> string subject = "Calendar test 3";
>> MailMessage emailMessage = new MailMessage();
>> emailMessage.To = <address>
>> emailMessage.Subject = "my subject";
>> emailMessage.Headers.Add("Content-Type","text/calendar;method=\"REQUEST\"");
>> emailMessage.Body=@."BEGIN:VCALENDAR
>> PRODID:-//ACME/DesktopCalendar//EN
>> METHOD:REQUEST
>> VERSION:2.0...<the rest of iCalendar>
>> ";
>> MailService.Send(emailMessage);
>>
>> Even though the content-type was specified in Headers collection the
>> resulting message still contains "text/plain" content-type.
>>
>> Please help.
>>
>> Vlad
I believe that if the email reader does not support the "text/calendar"
type, it is probably converting it to "text/plain". Why email reader are
you using? If you have a web access email account, you might try sending an
email to that account and view it in something like FireFox which supports
"text/calendar".
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."
"Vlad" <Vlad@.community.nospam> wrote in message
news:exIsoGMaGHA.4416@.TK2MSFTNGP04.phx.gbl...
>I dont think it has anything to do with HTML/Plain text. Content-type is
>email header--not HTTP header. I tried it anyways just to be safe and got
>the same results - plain text.
> Still need MSFT help with this!
> <guidomuffin@.hotmail.com> wrote in message
> news:1145909503.988524.208540@.i39g2000cwa.googlegr oups.com...
>> You probably need to set the BodyFormat property on your MailMessage
>> object to get the content-type to what you want.
>>
>> Example:
>>
>> MailMessage mail = new MailMessage();
>> mail.To = <address>
>> mail.From = <address>
>> mail.Subject = emailSubject;
>> mail.BodyFormat = System.Web.Mail.MailFormat.Html;
>>
>> Hope that helps
>>
>> http://www.harleyc.com
>>
>>
>> Vlad wrote:
>>> We are trying to set MailMessage Content-Type to be text/calendar
>>> The following code has been used:
>>> string subject = "Calendar test 3";
>>> MailMessage emailMessage = new MailMessage();
>>> emailMessage.To = <address>
>>> emailMessage.Subject = "my subject";
>>> emailMessage.Headers.Add("Content-Type","text/calendar;method=\"REQUEST\"");
>>> emailMessage.Body=@."BEGIN:VCALENDAR
>>> PRODID:-//ACME/DesktopCalendar//EN
>>> METHOD:REQUEST
>>> VERSION:2.0...<the rest of iCalendar>
>>> ";
>>> MailService.Send(emailMessage);
>>>
>>> Even though the content-type was specified in Headers collection the
>>> resulting message still contains "text/plain" content-type.
>>>
>>> Please help.
>>>
>>> Vlad
>>
Actually we use MS Outlook 2003 which does support it. We tried it with a
custom third-party component that sets the header fine. However when we did
it through .NET native component it didn't work.
--
Vlad
P.S. Please remove "REMOVETHIS" from my email address to reply...
"Christopher Reed" <carttu@.nospam.nospam> wrote in message
news:%23QNO$aOaGHA.4780@.TK2MSFTNGP02.phx.gbl...
>I believe that if the email reader does not support the "text/calendar"
>type, it is probably converting it to "text/plain". Why email reader are
>you using? If you have a web access email account, you might try sending
>an email to that account and view it in something like FireFox which
>supports "text/calendar".
> --
> Christopher A. Reed
> "The oxen are slow, but the earth is patient."
> "Vlad" <Vlad@.community.nospam> wrote in message
> news:exIsoGMaGHA.4416@.TK2MSFTNGP04.phx.gbl...
>>I dont think it has anything to do with HTML/Plain text. Content-type is
>>email header--not HTTP header. I tried it anyways just to be safe and got
>>the same results - plain text.
>>
>> Still need MSFT help with this!
>>
>> <guidomuffin@.hotmail.com> wrote in message
>> news:1145909503.988524.208540@.i39g2000cwa.googlegr oups.com...
>>> You probably need to set the BodyFormat property on your MailMessage
>>> object to get the content-type to what you want.
>>>
>>> Example:
>>>
>>> MailMessage mail = new MailMessage();
>>> mail.To = <address>
>>> mail.From = <address>
>>> mail.Subject = emailSubject;
>>> mail.BodyFormat = System.Web.Mail.MailFormat.Html;
>>>
>>> Hope that helps
>>>
>>> http://www.harleyc.com
>>>
>>>
>>> Vlad wrote:
>>>> We are trying to set MailMessage Content-Type to be text/calendar
>>>> The following code has been used:
>>>> string subject = "Calendar test 3";
>>>> MailMessage emailMessage = new MailMessage();
>>>> emailMessage.To = <address>
>>>> emailMessage.Subject = "my subject";
>>>> emailMessage.Headers.Add("Content-Type","text/calendar;method=\"REQUEST\"");
>>>> emailMessage.Body=@."BEGIN:VCALENDAR
>>>> PRODID:-//ACME/DesktopCalendar//EN
>>>> METHOD:REQUEST
>>>> VERSION:2.0...<the rest of iCalendar>
>>>> ";
>>>> MailService.Send(emailMessage);
>>>>
>>>> Even though the content-type was specified in Headers collection the
>>>> resulting message still contains "text/plain" content-type.
>>>>
>>>> Please help.
>>>>
>>>> Vlad
>>>
>>
>>
Actually we use MS Outlook 2003 which does support it. We tried it with a
custom third-party component that sets the header fine. However when we did
it through .NET native component it didn't work.
"Christopher Reed" <carttu@.nospam.nospam> wrote in message
news:%23QNO$aOaGHA.4780@.TK2MSFTNGP02.phx.gbl...
>I believe that if the email reader does not support the "text/calendar"
>type, it is probably converting it to "text/plain". Why email reader are
>you using? If you have a web access email account, you might try sending
>an email to that account and view it in something like FireFox which
>supports "text/calendar".
> --
> Christopher A. Reed
> "The oxen are slow, but the earth is patient."
> "Vlad" <Vlad@.community.nospam> wrote in message
> news:exIsoGMaGHA.4416@.TK2MSFTNGP04.phx.gbl...
>>I dont think it has anything to do with HTML/Plain text. Content-type is
>>email header--not HTTP header. I tried it anyways just to be safe and got
>>the same results - plain text.
>>
>> Still need MSFT help with this!
>>
>> <guidomuffin@.hotmail.com> wrote in message
>> news:1145909503.988524.208540@.i39g2000cwa.googlegr oups.com...
>>> You probably need to set the BodyFormat property on your MailMessage
>>> object to get the content-type to what you want.
>>>
>>> Example:
>>>
>>> MailMessage mail = new MailMessage();
>>> mail.To = <address>
>>> mail.From = <address>
>>> mail.Subject = emailSubject;
>>> mail.BodyFormat = System.Web.Mail.MailFormat.Html;
>>>
>>> Hope that helps
>>>
>>> http://www.harleyc.com
>>>
>>>
>>> Vlad wrote:
>>>> We are trying to set MailMessage Content-Type to be text/calendar
>>>> The following code has been used:
>>>> string subject = "Calendar test 3";
>>>> MailMessage emailMessage = new MailMessage();
>>>> emailMessage.To = <address>
>>>> emailMessage.Subject = "my subject";
>>>> emailMessage.Headers.Add("Content-Type","text/calendar;method=\"REQUEST\"");
>>>> emailMessage.Body=@."BEGIN:VCALENDAR
>>>> PRODID:-//ACME/DesktopCalendar//EN
>>>> METHOD:REQUEST
>>>> VERSION:2.0...<the rest of iCalendar>
>>>> ";
>>>> MailService.Send(emailMessage);
>>>>
>>>> Even though the content-type was specified in Headers collection the
>>>> resulting message still contains "text/plain" content-type.
>>>>
>>>> Please help.
>>>>
>>>> Vlad
>>>
>>
>>