Friendly Addresses and Mailer

35 views
Skip to first unread message

BartH

unread,
May 30, 2011, 2:34:49 PM5/30/11
to lif...@googlegroups.com
I would like to use Mailer to send email, but I need to include a friendly name in the From in addition to the email address. I am trying to do something like this, but I can't get my implicit into Mailer's scope:

  object FriendlyFrom {
    def apply(address: String, personal: String) = new FriendlyFrom(address, personal)
    
    implicit def friendlyFromToAddress(in: FriendlyFrom): Address = new InternetAddress(in.adr, in.personal)    
  }

  class FriendlyFrom(address: String, val personal: String) extends Mailer.From(address)


Is there any way around that? Does it make sense to build this functionality into Mailer for all address types?

Thanks

David Pollak

unread,
May 31, 2011, 1:54:21 PM5/31/11
to lif...@googlegroups.com
Feel free to open a ticket on this issue (http://ticket.liftweb.net you must be a watcher of the LiftWeb space on Assembla) and please reference this thread.

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



--
Lift, the simply functional web framework http://liftweb.net

BartH

unread,
May 31, 2011, 6:23:09 PM5/31/11
to lif...@googlegroups.com
http://www.assembla.com/spaces/liftweb/tickets/1029-mailer-addresses-should-support-optional-personal-name

Thanks David. In the meantime, do you see any way for me to make this work in my code without changing anything in the library?

David Pollak

unread,
May 31, 2011, 6:43:44 PM5/31/11
to lif...@googlegroups.com
On Tue, May 31, 2011 at 3:23 PM, BartH <bart...@gmail.com> wrote:
http://www.assembla.com/spaces/liftweb/tickets/1029-mailer-addresses-should-support-optional-personal-name

Thanks David. In the meantime, do you see any way for me to make this work in my code without changing anything in the library?

Yep, set the address to: David Pollak <feeder.of...@gmail.com>

The mail library will parse that correctly.
 

BartH

unread,
May 31, 2011, 6:59:11 PM5/31/11
to lif...@googlegroups.com
Wow ... I wasted way too much time with that implicit. Thank you for pointing out this obvious solution.

I demoted the priority of that ticket. Feel free to drop it even more if you want.


On Tuesday, May 31, 2011 3:43:44 PM UTC-7, David Pollak wrote:
On Tue, May 31, 2011 at 3:23 PM, BartH <bart...@gmail.com> wrote:
http://www.assembla.com/spaces/liftweb/tickets/1029-mailer-addresses-should-support-optional-personal-name

Thanks David. In the meantime, do you see any way for me to make this work in my code without changing anything in the library?

Yep, set the address to: David Pollak <feeder.of...@gmail.com>

The mail library will parse that correctly.
 


On Tuesday, May 31, 2011 10:54:21 AM UTC-7, David Pollak wrote:
Feel free to open a ticket on this issue (http://ticket.liftweb.net you must be a watcher of the LiftWeb space on Assembla) and please reference this thread.

On Mon, May 30, 2011 at 11:34 AM, BartH <bar...@gmail.com> wrote:
I would like to use Mailer to send email, but I need to include a friendly name in the From in addition to the email address. I am trying to do something like this, but I can't get my implicit into Mailer's scope:

  object FriendlyFrom {
    def apply(address: String, personal: String) = new FriendlyFrom(address, personal)
    
    implicit def friendlyFromToAddress(in: FriendlyFrom): Address = new InternetAddress(in.adr, in.personal)    
  }

  class FriendlyFrom(address: String, val personal: String) extends Mailer.From(address)


Is there any way around that? Does it make sense to build this functionality into Mailer for all address types?

Thanks

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftwe...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



--
Lift, the simply functional web framework http://liftweb.net

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

David Pollak

unread,
May 31, 2011, 7:01:50 PM5/31/11
to lif...@googlegroups.com
On Tue, May 31, 2011 at 3:59 PM, BartH <bart...@gmail.com> wrote:
Wow ... I wasted way too much time with that implicit. Thank you for pointing out this obvious solution.

I demoted the priority of that ticket. Feel free to drop it even more if you want.

Actually, it's a good feature because if my name is "david <il...@yaks.com> pollak" and my email address is "feeder.of...@gmail.com" then the string will be david <il...@yaks.com> pollak <feeder.of...@gmail.com> and that's a bad thing(tm)

 

BartH

unread,
May 31, 2011, 7:12:39 PM5/31/11
to lif...@googlegroups.com
Is your name really David'); drop table user; Pollack?

Might explain all of the security built in to Lift ;) Sorry, it never gets old ... http://xkcd.com/327/


On Tuesday, May 31, 2011 4:01:50 PM UTC-7, David Pollak wrote:
On Tue, May 31, 2011 at 3:59 PM, BartH <bart...@gmail.com> wrote:
Wow ... I wasted way too much time with that implicit. Thank you for pointing out this obvious solution.

I demoted the priority of that ticket. Feel free to drop it even more if you want.

Actually, it's a good feature because if my name is "david <il...@yaks.com> pollak" and my email address is "feeder.of...@gmail.com" then the string will be david <il...@yaks.com> pollak <feeder.of...@gmail.com> and that's a bad thing(tm)

 


On Tuesday, May 31, 2011 3:43:44 PM UTC-7, David Pollak wrote:
On Tue, May 31, 2011 at 3:23 PM, BartH <bar...@gmail.com> wrote:
http://www.assembla.com/spaces/liftweb/tickets/1029-mailer-addresses-should-support-optional-personal-name

Thanks David. In the meantime, do you see any way for me to make this work in my code without changing anything in the library?

Yep, set the address to: David Pollak <feeder...@gmail.com>


The mail library will parse that correctly.
 


On Tuesday, May 31, 2011 10:54:21 AM UTC-7, David Pollak wrote:
Feel free to open a ticket on this issue (http://ticket.liftweb.net you must be a watcher of the LiftWeb space on Assembla) and please reference this thread.

On Mon, May 30, 2011 at 11:34 AM, BartH <bar...@gmail.com> wrote:
I would like to use Mailer to send email, but I need to include a friendly name in the From in addition to the email address. I am trying to do something like this, but I can't get my implicit into Mailer's scope:

  object FriendlyFrom {
    def apply(address: String, personal: String) = new FriendlyFrom(address, personal)
    
    implicit def friendlyFromToAddress(in: FriendlyFrom): Address = new InternetAddress(in.adr, in.personal)    
  }

  class FriendlyFrom(address: String, val personal: String) extends Mailer.From(address)


Is there any way around that? Does it make sense to build this functionality into Mailer for all address types?

Thanks

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to lift...@googlegroups.com.

David Pollak

unread,
May 31, 2011, 7:19:48 PM5/31/11
to lif...@googlegroups.com
On Tue, May 31, 2011 at 4:12 PM, BartH <bart...@gmail.com> wrote:
Is your name really David'); drop table user; Pollack?

Yep... that'd be me. ;-)
 
Reply all
Reply to author
Forward
0 new messages