How?
Check out the System.Net.Mail.SmtpClient and System.Net.Mail.MailMessage classes.
-Brock
Hello.
I think that you're sepaking about the ability of the new security controls which are able to notify the user by sending email messages. If that's the case then you're right: by default you can only send the username and the password.
However, nothing prevents you from using a similar scheme used internally by the controls. Since I think you're talking about the createuserwizard you can do this by processing the sendingmail event of that control. In that method you could use a regular expression to replace the text you want. Hope this helps.
Actually I am not talking about the CreateUserWizard in specific. It can be any mail that can have any number of parameters.
Can you show me an example of RegularExpression to replace a parameter?
Hello again.
It's very simple. For isntance, let's suppose you have a field called <% Company %> on your mail template. Then I think this would do the trivk:
<code>
protected void ProcessMail( object sender, MailMessageEventArgs args )
{
args.Message.Body = Regex.Replace( args.Message.Body, @."<%\s*Company\s*%>", "Teste Empresa", RegexOptions.IgnoreCase );
}
</code>
Since you're processing the SendingMail event there's no need to replace the username and password parameters because they have already been replaced.
This works fine.
I want to insert images in my email. So I have the following in my text file:
<td valign="top" align="left">
<asp:Image ID="Image1" Runat="Server"ImageUrl="http://mySite.com/Images/myLogo.gif" />
</td>
I also have set the following in my code-behind:
Message.UrlContentLocation = "http://mySite.com/Images/"
Message.UrlContentBase = "http://mySite.com/Images/"
But this doesn't work.
Hello again. Sorry, I'm not following you. The message variable you're in codebehind...what's its type?
It was a bug that I fixed. Let me explain what was going on. It may help others.
In my text file, I have a variable called p_Topic and p_TopicID.I then call the Replace method to replace p_Topic by say FAQ.What happens is p_Topic gets replaced as expected but p_TopicID becomesFAQID. So the second replace (where I want to substitute p_TopicID)never works as it can never find p_TopicID..
I fixed this by chaning the name of the variable to p1_Topic and p2_TopicID
0 comments:
Post a Comment