Gossamer Forum
Home : Products : Gossamer Links : Discussions :

gt::mail from ?

Quote Reply
gt::mail from ?
How can I get my from in the gt::mail module to be in the format...

Jonathan Gamble <webmaster@magicdirectory.com>

or something similar so that when I receive the email in outlook, it will display the name (and when I click on the name the email!)?

I have tried something like this:

Code:

my $from = $IN->param('Email') . " <" . $IN->param('Name') . ">";

GT::Mail->send (
smtp => $CFG->{db_smtp_server},
sendmail => $CFG->{db_mail_path},
to => $CFG->{db_admin_email},
from => $from,
subject => $IN->param('Subject'),
reply => $IN->param('Email'),
msg => $IN->param('Comments'),
debug => $Links::DEBUG
)


But... no results... anyone? anyone?

Thanks,

- Jonathan
Quote Reply
Re: [jdgamble] gt::mail from ? In reply to
Shouldn't this line be the other way around?

my $from = $IN->param('Email') . " <" . $IN->param('Name') . ">";

i.e;

my $from = $IN->param('Name') . " <" . $IN->param('Email') . ">";

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] gt::mail from ? In reply to
Yeah thats what I had (just typed it real quick Wink)...

I get this error message:

Quote:

GT::Mail (793): No message head was specified at file.cgi line 55.


But if I replace
Code:
from => $from,
with
Code:
from => $IN->param('Email'),


I do not get the error. This, however, does not solve my problem.

Any other ideas?

Thanks,

- Jonathan
Quote Reply
Re: [jdgamble] gt::mail from ? In reply to
Forgot to post that I figured it out...

My form was submitting $IN->param('Contact Name') instead of $IN->param('Name') which would give an error no matter what $from was set to.

Thanks again for the help,

- Jonathan