Error during method "CreateMailMessage" from "MailDefinition" object - error: The specified string is not in the form required for an e-mail address.

 Hi, I am having trouble to send E-mail when using maildefinition object. I need to read email body from external txt file, then do some replacements and send it. Only way (what i know - instead of writing my own code), how to get the text  to the body of MailMessage is using the MailDefinition method 

BodyFileName()

When I set everythig up after atempt to send the email I get this error: "The specified string is not in the form required for an e-mail address." I am sure, that the adress i right(it' even valiated throug regularexpretion validator).

 Does any body know what's wrong with this code? :

 

Dim emailadrr As String = "somebody@somewhere.com"

Dim replacements As ListDictionary = New ListDictionary

replacements.Add("<% UserName %>", user.UserName)

replacements.Add("<% Link %>", serverAppDir & "/login.aspx?")

Dim mmsg As MailMessage = md.CreateMailMessage(emailadrr, replacements, Me)  'here it's throw the error

 
 

 

 

0
Petulka77
10/3/2007 7:51:35 PM
asp.net.web-forms 93655 articles. 5 followers. Follow

1 Replies
721 Views

Similar Articles

[PageSpeed] 9

Petulka77:
The specified string is not in the form required for an e-mail address.
 

Hi Petulka77,

There is another thread talk about this issue, see the link first: http://forums.asp.net/p/987948/1276972.aspx,

and you can follow Ryan's answer, and I am sure the thread can help you to solve your problem.

 

Please correct me if I have misunderstood your mean, please LET ME KNOW, Thanks, 

Hope it helps,

Hong Gang


Hong-Gang Chen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Hong
10/9/2007 8:32:14 AM
Reply:

Similar Artilces:

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD 9.0.0.580. Bruce "Bruce Lamb" <lamb.bruce@mayo.edu> wrote in message news:6HgI315nCHA.155@forums.sybase.com... > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

Precedence of "where" ("of", "is", "will")?
Nobody on #perl6 today could answer this one. Is: Str | Int where { $_ } the same as: (Str | Int) where { $_ } or: Str | (Int where { $_ }) ? Followup questions, Mr. President: What kind of operators are "where", "of", "is", and "will"? Is there a reason that S03 doesn't list them? What are their precedence(s)? -- Chip Salzenberg - a.k.a. - <chip@pobox.com> Open Source is not an excuse to write fun code then leave the actual work to others. Chip Salzenberg writes: &...

"SSL" "Mail" and "Code"
Does anybody know of any discussions taking place within Mozilla regarding these 3 bits in the certificate manager? Perhaps I've missed something in the discussions here. In any case, I think a new mechanism for indicating trust w/in the Mozilla apps are needed. Take for example the "StartCom Certification Authority" root. The Certificate Manager (I'm using Firefox on Windows) says it can identify web sites, email users, and code yet the cert itself says it can only be used for signing other certs (essentially, that is). At a minimum this is confusing but I have...

pulling out "a","an", "the" from beginning of strings
I need to pull out articles "a", "an", and "the" from the beginning of title strings so that they sort properly in MySQL. What is the best way to accomplish that if I have a single $scalar with the whole title in it? Thanks, Tim -- Tim McGeary tim.mcgeary@lehigh.edu --=-weUphL4mkB1WR5g+DMDc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > I need to pull out articles "a", "an", and "the" from the beginning of=20 >...

quotes, quotes, quotes...
I am getting this error and I know what is causing it, but I have no idea how to fix it, any help would be great. The script steps through the /var/log/messages file on a linux server and puts The entries into a mysql database. However when it gets to the 'hlt' line in the messages file it just barfs. The single quotes are freaking it out. I know about quotes but not how to use in this situation. Thanks, Paul Error: May 27 17:53:00 localhost kernel: Checking 'hlt' instruction... OK. <----- doesn't like this in the messages file DBD::mysql::st exec...

The different between ""form title" and "page title"
I'm new to ASP .NET and i can't figure out what is the different between the "title 1" and "title 2" in the following code? <HTML> <HEAD> <title>title 1</title> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="form1" method="post" runat="server" title="title 2""> </form> </body> </HTML> Top of Form it seems to me that "title 2" has no effect on the page title. You are Correct.. The <title&g...

<form id="form" runat="server">
hey i have a very similar problem to this thread http://forums.asp.net/thread/1440587.aspx"Control 'ctl00_ContentPlaceHolder1_Login1' of type 'Login' must be placed inside a form tag with runat=server. 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.Web.HttpException: Control 'ctl00_ContentPlaceHolder1_Login1' of type 'Login' must be placed inside a form tag with r...

How to adopt: Dim rowValues As Object() = {"","",""}?
Hi guys! I'm trying to adopt the code from the Editable Data Grid template. My underlying table has 3 columns: 1st: int(4), identity, autoincrement; 2nd:datetime(8); 3rd:varchar. What do I need to specify in Dim rowValues As Object() = {"","",""} instead of the first and second "" to get rid of the System.FormatException: Input string was not in a correct format… Thanks ...

Get "Mail"/"Get "News" / "Write"/"Post" buttons?
If the "Get Mail" button text changed to "Get News", and "Write" changed to "Post" when TB's in the news-reading mode, it would save me and probably others from constantly forgetting to make the change before proceeding. :-) Or is there an extension to do this which I don't know about? Thanks! Bob Bob P wrote: > If the "Get Mail" button text changed to "Get News", and "Write" > changed to "Post" when TB's in the news-reading mode, it would save me > and probably others...

"Me" is better than "You"
Yes I know, strings are frozen. But let me talk about it, I really can't get through the idea of a PC talkin to me. I consider my PC as an extension of myself, not a dumb companion who addresses Me as You. Yes there are times when I get angry with Him while I work and get wrong calculations etc.., but it really is my fault, Me using wrong istructions and eventually wanting to find someone else to blame, but it's Me. And yes, I consider Thunderbird my mail program, reading my mail on my PC as Me. So I personally like to have Me in the header bar as a compact address ...

double quote
hello there...  i tried everything of think but not working the way i wanted to be... not sure what i'm missing...i'm generating a <span> in code behind and then using in javascript.... here is what i'm doing code behind: int i=0string _keywordID = "keyword";string _name = row["visit_info_nm"].ToString().Trim(); String _getElementByID = String.Format("<span id='{0}' OnClick = \"document.getElementById('{1}').value='{2}';\">{3}</span><br>", i, _keywordID, _name, _name); here is what it generate : <span id='1' OnClick = \"document.getElementById('keyword')...

"Using" or "With"
Hi all Please can someone enlighten to me as regards the difference with the "Using" and "With" statement when accessing data - which is better, what are the limitations and/or any pointers. Many thanks. Regards DaveDavid WinchesterPlease mark as answer if this is the solution.  using gives you the ability to use the connection and it closes the connection directlly after you finish using it. and there is no need to try- cach - finaly. there is no limitation on using USING keywordMuhanad YOUNISMCSD.NETMy Blog || My Photos || LinkedIn I have a dataobject the re...

replace the "." with a ","
Oi.... I need to build a small programm in ASP.NET and chose to use C# for it.Now i got everything working but there's one little problem.the first textbox is a double. I need to make it so that when someone enters a "." then it gets replaced by a ","any ideas?Ghan  string blah = "4.2.2.2";blah = blah.Replace(".", ",");Ryan Ryan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question...

Encrypting "connection strings" and "mail settings" in web.config
I'm trying to encrypt two sections of my web.config.  Encryption works fine when I try encrypting either <connectionStrings> or <system.net/mailSettings/smtp> alone.  But when I try and do both together, I get an error and only the <connectionStrings> section encrypts properly.  Here's the error:Parser Error Message: The configuration file has been changed by another program.Source Error: [No relevant source lines] Here's the code I'm using . . .protected void EncryptConfig(bool bEncrypt) {obje...

"-" not "_"
I wrote a SQL statement in the data tab. I wrote a bunch of alaises as example ' word-type ' but when I hit the layout tab it converts the "-" to "_". So now my field name is ' word_type '. Is there any way to prevent this? CardGunner Don' use a hypen ( - ).  It isn't a valid character for column names.   See http://searchsqlserver.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid87_gci1188931,00.html   Here's an excerpt about column names: Letters as defined in the Unicode Standard 2.0 Decimal numbers from either B...

Web resources about - Error during method "CreateMailMessage" from "MailDefinition" object - error: The specified string is not in the form required for an e-mail address. - asp.net.web-forms

Resources last updated: 1/8/2016 8:51:49 AM