Author |
|
zcast Newbie
Joined: 10 July 2011 Location: United States
Online Status: Offline Posts: 15
|
Posted: 30 August 2011 at 9:45am | IP Logged
|
|
|
I have a listbox which contains the email of a recipient as one item. I have 5 recipients, meaning I have 5 items. How can i parse these items, and send with Mailbee.smtp? When I try to do it just pointing to the listbox, or pointing to the listbox.items.tostring, it doesn't work. Any help would be appreciated. Thank you.
Kevin
|
Back to Top |
|
|
zcast Newbie
Joined: 10 July 2011 Location: United States
Online Status: Offline Posts: 15
|
Posted: 30 August 2011 at 1:01pm | IP Logged
|
|
|
This is really crazy... I have figured out how to add the recipients from the listbox into a Mailmessage collection, but the problem is the syntax is all jacked up.....for whatever reason, there is always a "<" character, and a ">" character added to the beginning and end of my string, which is causing the server to reject the recipient.....I have tried every way possible to format my string to get it right...as long as I DON"T send a Name in the same string as my email address it will work. But if I try to send a name along with the email address, it fails... I have coded my strings as:
"myemailaddress@fido.com", "Name" and it goes to the server like this:
<"myemailaddress@fido.com", "Name">---> which causes it to reject the recipient
I have done this:
<myemailaddress@fido.com>, "Name" and it goes to the server like this:
<<myemailaddress@fido.com>, "Name">----> which causes it to be rejected as well.
I'm not understanding where the extra "<,>" symbols are coming from???????
Kevin
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 31 August 2011 at 12:13am | IP Logged
|
|
|
Please clarify how exactly you are supplying this one:
Quote:
<myemailaddress@fido.com>, "Name" |
|
|
Attempting to supply it as a single string wouldn't work since that's not correct format, that should be something like:
Quote:
Name <myemailaddress@fido.com> |
|
|
or:
Quote:
"Name" <myemailaddress@fido.com> |
|
|
You can, however, supply email address and display name separately with this To.Add overload. Another overload with single argument should be used when there's only email address available and no name given.
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
zcast Newbie
Joined: 10 July 2011 Location: United States
Online Status: Offline Posts: 15
|
Posted: 31 August 2011 at 7:33am | IP Logged
|
|
|
Thank you Igor for responding...I have attached an image of how the addresses look befofe being added to the email collection, and then what happens or how they are sent to the server....
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 31 August 2011 at 7:36am | IP Logged
|
|
|
Thanks, but that doesn't describe how exactly you supply those addresses. My previous message describes a number of ways, are you using any of them?
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
zcast Newbie
Joined: 10 July 2011 Location: United States
Online Status: Offline Posts: 15
|
Posted: 31 August 2011 at 7:46am | IP Logged
|
|
|
The above example is with the addresses coming from a textbox.. This example is with them coming from a listbox.
What is happening:
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 31 August 2011 at 7:51am | IP Logged
|
|
|
Try to hard-code everything in the code. E.g. somewhat like:
mailer.From.AsString = "Name <email@address.com>";
If this works, this means MailBee's side of things is ok and the problem occurs before MailBee gets in the game.
regards,
Alex
|
Back to Top |
|
|
zcast Newbie
Joined: 10 July 2011 Location: United States
Online Status: Offline Posts: 15
|
Posted: 31 August 2011 at 8:38am | IP Logged
|
|
|
I will try hard-coding some addresses, adding them to a email collection, and see what that does. When I'm sending emails with just the email address, it works beautifully, when I try to add the name to the address, is when it doesn't work. I format the recipient as "Bob" <bob@somwhere.com>, but once it gets added to the email collection it goes to the server as such <"bob" <obo@somewhere.com>>, it always adds the extra < at the beginning, and the extra ">" at the end when using an email collection. The addresses themselves are being formatted correctly.
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 31 August 2011 at 9:34am | IP Logged
|
|
|
Maybe you're just using EmailAddressCollection.Add(string) method?
Its description clearly says that it accepts only "pure" email address and suggests to use EmailAddressCollection.AddFromString method if you need to add email address with friendly name.
Regards,
Alex
|
Back to Top |
|
|