Wednesday, March 28, 2012
Troubble with links in emails
I was sure this was an issue with the mail client, but apparently many of our customers are experiencing the same problem. I haven't been able to reproduce this problem myself because all my email clients display the links properly, but I have had some of our clients forward the mails to me, and the dot is actually missing. (http://www.blablacom/Page.aspx).
Have any of you guys seen this problem before? And how can I solve it?Are you still using the Beta version??
Yes, this is beta 2. I haven't been able to test it on the final version yet, because I can't reproduce the problem myself and we haven't shipped the new version to our customers yet.
Do you think it will work differently in the final version?
This is an issue that I haven't heard of earlier. I suggest you download the RTM of the .Net Framework and install it (remember to uninstall any beta version before installing if you intend to do this on the same machine). If your problem remains, I suggest you check the original data and code for string manipulation methods which may cause dots to disappear.
We uninstalled Beta 2 and installed RTM. This solved the problem without any changes to the code.
Saturday, March 24, 2012
Trouble sending email with ASP.NET 2.0
certain form is submitted. When it tries to send the email, I receive the
following error:
Transaction failed. The server response was: njsokalski@dotnet.itags.org.hotmail.com:
Recipient address rejected: Access denied
(in the error message, the part with the email address was displayed as
<myemailaddress>, but you will probably see a link because our news viewers
think they know what we want). I know that the address is correct, so what
is it that the server didn't like about it? Is it saying I don't have
permission to use the SMTP server (I was pretty sure I was, but this is the
first time I am sending email from this server)? Is there something wrong
with my code? Any help would be appreciated. Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/On Fri, 5 Jan 2007 03:55:44 -0500, "Nathan Sokalski"
<njsokalski@.hotmail.com> wrote:
> Is there something wrong
>with my code? Any help would be appreciated. Thanks.
You didn't provide your code, so it is hard to tell.
However, this works for me:
Try
Dim mail As New Mail.MailMessage()
mail.From = New Mail.MailAddress("mail@.mail.somewhere",
"Subject")
mail.To.Add("another@.mail.somewhere")
mail.Subject = "Subject"
mail.Body = "Body"
Dim smtp As New Mail.SmtpClient("mail.planprojekt.dk")
smtp.Credentials = New
NetworkCredential("mail@.mail.somewhere", "password")
smtp.Send(mail)
bEmailSent = True
Catch ex As Exception
Exit Sub
End Try
/Snedker
If you are using the machine's local SMTP Service,
you may need to add a Smarthost or domains (e.g., "*.com", "*.net")
so that email sent through it is allowed to be sent out or relayed.
Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Nathan Sokalski" wrote:
> I have an ASP.NET 2.0 application that is supposed to send an email after
a
> certain form is submitted. When it tries to send the email, I receive the
> following error:
>
> Transaction failed. The server response was: njsokalski@.hotmail.com:
> Recipient address rejected: Access denied
>
> (in the error message, the part with the email address was displayed as
> <myemailaddress>, but you will probably see a link because our news viewer
s
> think they know what we want). I know that the address is correct, so what
> is it that the server didn't like about it? Is it saying I don't have
> permission to use the SMTP server (I was pretty sure I was, but this is th
e
> first time I am sending email from this server)? Is there something wrong
> with my code? Any help would be appreciated. Thanks.
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
>
>
The code I am using is as follows:
Private Sub SendEmailNotification()
Dim confsender As New
SmtpClient(System.Configuration.ConfigurationManager.AppSettings("smtpserver
"))
Dim confirmation As New MailMessage()
confirmation.IsBodyHtml = False
confirmation.From = New MailAddress("fromaddress@.mydomain.com")
confirmation.To.Add("njsokalski@.hotmail.com")
confirmation.Subject = "My Subject"
confirmation.Body = "My Body"
confsender.Send(confirmation)
End Sub
Thanks.
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/
"Morten Snedker" <morten_spammenot_ATdbconsult.dk> wrote in message
news:2p6sp2dqb6qkfg0j60i3gt12iqvhdgcj70@.
4ax.com...
> On Fri, 5 Jan 2007 03:55:44 -0500, "Nathan Sokalski"
> <njsokalski@.hotmail.com> wrote:
>
> You didn't provide your code, so it is hard to tell.
> However, this works for me:
> Try
> Dim mail As New Mail.MailMessage()
> mail.From = New Mail.MailAddress("mail@.mail.somewhere",
> "Subject")
> mail.To.Add("another@.mail.somewhere")
> mail.Subject = "Subject"
> mail.Body = "Body"
> Dim smtp As New Mail.SmtpClient("mail.planprojekt.dk")
> smtp.Credentials = New
> NetworkCredential("mail@.mail.somewhere", "password")
> smtp.Send(mail)
> bEmailSent = True
> Catch ex As Exception
> Exit Sub
> End Try
>
> /Snedker
Trouble sending email with ASP.NET 2.0
certain form is submitted. When it tries to send the email, I receive the
following error:
Transaction failed. The server response was: njsokalski@dotnet.itags.org.hotmail.com:
Recipient address rejected: Access denied
(in the error message, the part with the email address was displayed as
<myemailaddress>, but you will probably see a link because our news viewers
think they know what we want). I know that the address is correct, so what
is it that the server didn't like about it? Is it saying I don't have
permission to use the SMTP server (I was pretty sure I was, but this is the
first time I am sending email from this server)? Is there something wrong
with my code? Any help would be appreciated. Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/On Fri, 5 Jan 2007 03:55:44 -0500, "Nathan Sokalski"
<njsokalski@.hotmail.comwrote:
Quote:
Originally Posted by
Is there something wrong
>with my code? Any help would be appreciated. Thanks.
You didn't provide your code, so it is hard to tell.
However, this works for me:
Try
Dim mail As New Mail.MailMessage()
mail.From = New Mail.MailAddress("mail@.mail.somewhere",
"Subject")
mail.To.Add("another@.mail.somewhere")
mail.Subject = "Subject"
mail.Body = "Body"
Dim smtp As New Mail.SmtpClient("mail.planprojekt.dk")
smtp.Credentials = New
NetworkCredential("mail@.mail.somewhere", "password")
smtp.Send(mail)
bEmailSent = True
Catch ex As Exception
Exit Sub
End Try
/Snedker
The code I am using is as follows:
Private Sub SendEmailNotification()
Dim confsender As New
SmtpClient(System.Configuration.ConfigurationManag er.AppSettings("smtpserver"))
Dim confirmation As New MailMessage()
confirmation.IsBodyHtml = False
confirmation.From = New MailAddress("fromaddress@.mydomain.com")
confirmation.To.Add("njsokalski@.hotmail.com")
confirmation.Subject = "My Subject"
confirmation.Body = "My Body"
confsender.Send(confirmation)
End Sub
Thanks.
--
Nathan Sokalski
njsokalski@.hotmail.com
http://www.nathansokalski.com/
"Morten Snedker" <morten_spammenot_ATdbconsult.dkwrote in message
news:2p6sp2dqb6qkfg0j60i3gt12iqvhdgcj70@.4ax.com...
Quote:
Originally Posted by
On Fri, 5 Jan 2007 03:55:44 -0500, "Nathan Sokalski"
<njsokalski@.hotmail.comwrote:
>
Quote:
Originally Posted by
>Is there something wrong
>>with my code? Any help would be appreciated. Thanks.
>
You didn't provide your code, so it is hard to tell.
>
However, this works for me:
>
Try
Dim mail As New Mail.MailMessage()
>
mail.From = New Mail.MailAddress("mail@.mail.somewhere",
"Subject")
mail.To.Add("another@.mail.somewhere")
>
mail.Subject = "Subject"
mail.Body = "Body"
>
Dim smtp As New Mail.SmtpClient("mail.planprojekt.dk")
smtp.Credentials = New
NetworkCredential("mail@.mail.somewhere", "password")
smtp.Send(mail)
>
bEmailSent = True
Catch ex As Exception
Exit Sub
End Try
>
>
/Snedker
Trouble w sending email
Trying to send an email with .net from my home computer.
A very simple one...
***************************
<%@dotnet.itags.org. Page Language="VB" %>
<%@dotnet.itags.org. Import Namespace="System.Web.Mail" %>
<script runat="server">
Sub Button1_Click(sender As Object, e As EventArgs)
SmtpMail.Send( _
"kenneth.philp@dotnet.itags.org.sverige.nu", _
"kenneth.philp@dotnet.itags.org.sverige.nu", _
"Testing mail", _
"Just sending a test message!")
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server" ID="Form1">
<asp:Button id="Button1" onclick="Button1_Click" runat="server"
Text="Button"></asp:Button>
</form>
</body>
</html>
**********************
I'm getting this error message
********************************
Configurationvalue "SendUsing" not valid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information abou
t
the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException:
Configurationvalue "SendUsing" not valid.
Source Error:
Line 4:
Line 5: Sub Button1_Click(sender As Object, e As EventArgs)
Line 6: SmtpMail.Send( _
Line 7: "kenneth.philp@dotnet.itags.org.sverige.nu", _
Line 8: "kenneth.philp@dotnet.itags.org.sverige.nu", _
*********************************
I've checked that smtp services are on
What does "Sendusing" indicate?
Cheers.
KennethThe problem might be cos you're not specifying the SMTP server to send
through.
"Kenneth P" <KennethP@.discussions.microsoft.com> wrote in message
news:E07039CF-3FD5-49CD-BF51-EE5BF7A5BFF6@.microsoft.com...
> Hi,
> Trying to send an email with .net from my home computer.
> A very simple one...
> ***************************
> <%@. Page Language="VB" %>
> <%@. Import Namespace="System.Web.Mail" %>
> <script runat="server">
> Sub Button1_Click(sender As Object, e As EventArgs)
> SmtpMail.Send( _
> "kenneth.philp@.sverige.nu", _
> "kenneth.philp@.sverige.nu", _
> "Testing mail", _
> "Just sending a test message!")
> End Sub
> </script>
> <html>
> <head>
> </head>
> <body>
> <form runat="server" ID="Form1">
> <asp:Button id="Button1" onclick="Button1_Click" runat="server"
> Text="Button"></asp:Button>
> </form>
> </body>
> </html>
> **********************
> I'm getting this error message
> ********************************
> Configurationvalue "SendUsing" not valid.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
about
> the error and where it originated in the code.
> Exception Details: System.Runtime.InteropServices.COMException:
> Configurationvalue "SendUsing" not valid.
> Source Error:
>
> Line 4:
> Line 5: Sub Button1_Click(sender As Object, e As EventArgs)
> Line 6: SmtpMail.Send( _
> Line 7: "kenneth.philp@.sverige.nu", _
> Line 8: "kenneth.philp@.sverige.nu", _
> *********************************
> I've checked that smtp services are on
> What does "Sendusing" indicate?
> Cheers.
> Kenneth
Trouble w sending email
Trying to send an email with .net from my home computer.
A very simple one...
***************************
<%@dotnet.itags.org. Page Language="VB" %>
<%@dotnet.itags.org. Import Namespace="System.Web.Mail" %>
<script runat="server"
Sub Button1_Click(sender As Object, e As EventArgs)
SmtpMail.Send( _
"kenneth.philp@dotnet.itags.org.sverige.nu", _
"kenneth.philp@dotnet.itags.org.sverige.nu", _
"Testing mail", _
"Just sending a test message!")
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server" ID="Form1">
<asp:Button id="Button1" onclick="Button1_Click" runat="server"
Text="Button"></asp:Button>
</form>
</body>
</html>
**********************
I'm getting this error message
********************************
Configurationvalue "SendUsing" not valid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException:
Configurationvalue "SendUsing" not valid.
Source Error:
Line 4:
Line 5: Sub Button1_Click(sender As Object, e As EventArgs)
Line 6: SmtpMail.Send( _
Line 7: "kenneth.philp@dotnet.itags.org.sverige.nu", _
Line 8: "kenneth.philp@dotnet.itags.org.sverige.nu", _
*********************************
I've checked that smtp services are on
What does "Sendusing" indicate?
Cheers.
KennethThe problem might be cos you're not specifying the SMTP server to send
through.
"Kenneth P" <KennethP@.discussions.microsoft.com> wrote in message
news:E07039CF-3FD5-49CD-BF51-EE5BF7A5BFF6@.microsoft.com...
> Hi,
> Trying to send an email with .net from my home computer.
> A very simple one...
> ***************************
> <%@. Page Language="VB" %>
> <%@. Import Namespace="System.Web.Mail" %>
> <script runat="server">
> Sub Button1_Click(sender As Object, e As EventArgs)
> SmtpMail.Send( _
> "kenneth.philp@.sverige.nu", _
> "kenneth.philp@.sverige.nu", _
> "Testing mail", _
> "Just sending a test message!")
> End Sub
> </script>
> <html>
> <head>
> </head>
> <body>
> <form runat="server" ID="Form1">
> <asp:Button id="Button1" onclick="Button1_Click" runat="server"
> Text="Button"></asp:Button>
> </form>
> </body>
> </html>
> **********************
> I'm getting this error message
> ********************************
> Configurationvalue "SendUsing" not valid.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
about
> the error and where it originated in the code.
> Exception Details: System.Runtime.InteropServices.COMException:
> Configurationvalue "SendUsing" not valid.
> Source Error:
>
> Line 4:
> Line 5: Sub Button1_Click(sender As Object, e As EventArgs)
> Line 6: SmtpMail.Send( _
> Line 7: "kenneth.philp@.sverige.nu", _
> Line 8: "kenneth.philp@.sverige.nu", _
> *********************************
> I've checked that smtp services are on
> What does "Sendusing" indicate?
> Cheers.
> Kenneth
Tuesday, March 13, 2012
Troubles sending email with System.Net.Mail (ASP.NET 2.0)
Hi All,
I am having difficulties sending an email from a web page that I created to my own email. This particular web pages is suppose to be a feedback form where people can leave feedback about the site and it should send the message to my email. The Exception message I get is: "Failure sending mail." Here is the piece of code I use to handle the email sending. If anyone can shed some light on this issue, it would be greatly appreciated :)
protectedvoid btnSubmit_Click(object sender,EventArgs e){
try
{
SmtpClient emailClient =newSmtpClient();MailMessage email =newMailMessage();
emailClient.Host ="localhost";emailClient.Port = 25;
email.To.Add(newMailAddress("kevintrinh.n@dotnet.itags.org.gmail.com"));email.From =newMailAddress(txtEmail.Text);
email.Subject ="Enquiry";email.Body ="Testing";
email.IsBodyHtml =false;emailClient.Send(email);
}
catch(Exception ex){
Response.Write(ex.Message);
}
}
Cheers guys
Check the SMTP logs to start troubleshooting this.
Jeff
You'll need more detailed error info to get help.
One quick thing to check, is antivirus software on your computer blocking your code from sending email?
I have a feedback page, too, and it works great. Here's my code:
The Click Event:
public void SendMail_Click(object sender, EventArgs e)
{
SendMail();
}
public void SendMail()
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress(WebConfigurationManager.AppSettings["DefaultMailFrom"], "Internet User: " + txtName.Text);
mail.To.Add(WebConfigurationManager.AppSettings["DefaultMailTo"]);
if (txtEmail.Text.Trim() != "")
mail.ReplyTo = new MailAddress(txtEmail.Text.Trim());
//set the content
mail.Subject = txtSubject.Text;
mail.Body = txtBody.Text;
mail.Body += "\n\nReferring page: " + lnkReferrerF.NavigateUrl;
//send the message
SmtpClient smtp = new SmtpClient(WebConfigurationManager.AppSettings["DefaultMailServer"]);
smtp.Send(mail);
}
And then under <AppSettings> in the web.config file I have:
<add key="DefaultMailFrom" value="mailer@.site.com" />
<add key="DefaultMailReplyTo" value="david@.site.com" />
<add key="DefaultMailTo" value="david@.site.com" />
<add key="DefaultMailServer" value="mailserver name" />
Hope this helps.
Kevin-
If you're currently trying to run this on your local PC, make sure you have an SMTP server running on your box. Open up the IIS Configuration in your Control Panel > Administrative Tools and make sure the Default SMTP Virtual Server is started.
Thanks~
Hi everyone,
Thanks for all the insight...I really appreciate it. I will take a look at all your suggestions and follow up. Thanks again guys :)
Cheers
Dear Friend,
Also check out if you are running any anti virus scanners. Sometimes those applications blocks the port for sending out the emails. You may need to configure them to send out the emails.
tanglin05:
Kevin-
If you're currently trying to run this on your local PC, make sure you have an SMTP server running on your box. Open up the IIS Configuration in your Control Panel > Administrative Tools and make sure the Default SMTP Virtual Server is started.
Thanks~
Hi Todd,
I think this is my problem. I've taken a look on the net and all the tutorials explain the procedure to configure the virtual smtp server for all windows other than VISTA. Just wondering if you know how to configure the settings on vista or if you/anyone know of any links that may point me in the right direction?
In the mean time I will continue looking for explanations online :)
Thanks mate.
Kevin-
I'm away from my desktop right now, so I don't have Vista handy. Based on these posts I found on the Net, it appears SMTP may not be in Vista (?!):
http://tfl09.blogspot.com/2007/03/smtp-in-vista-or-not.html
http://weblogs.asp.net/steveschofield/archive/2006/12/19/iis7-post-23-vista-and-smtp-server-where-is-it.aspx
I can't verify this right now, so if anyone knows otherwise please correct me. The links I provided have references to shareware SMTP servers that you can install to solve your problem, so this may help you get on your way.
Thanks~
Todd you're a champ mate...I downloaded a free smtp server and it sends now
Just some tips for anyone else with a similar problem. If you are trying to send emails from you local machine, make sure the ISP you are going through does not block port 25 (else your emails cannot be sent). I found that I could send from uni but I couldn't send from home (for the above reason)
If everything seems ok with your code and server setup however you do not receive any emails.....check your SPAM folder!! (This is also what happened to me; spent 2 long hours trying to work out why I wasn't receiving any emails!)
I found the following SMTP server application to be the most useful one out there as it allows you to test whether port 25 is open. You can download the free 30day trial here1st SMTP Server
Hope this helps anyone facing the same email problems as I did');" title="Smile -
">
Thanks again everyone for your help');" title="Yes -
">