Sending HTML Email Using EMAIL::MIME::CreateHTML

------_=_NextPart_001_01C7D5F2.CEEC49EF
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I am using the Email::MIME:CreateHTML module to send html formatted
emails.  It all works fine until I try to change the "To" line to a
scalar so that I can mass mail to different individuals.  Has anyone
used this module in a manner like this before?  Thanks,

my $email =3D travis_hervey@georgetowncollege.edu;

while(<DAT>)

{

        $line =3D TRIM($_);

        $html =3D $html . $_;

        if($line eq "</body>")

        {

my $email =3D Email::MIME->create_html(

        header =3D> [

                From =3D> 'travis_hervey@georgetowncollege.edu',

                To =3D> '$email',

                Subject =3D> 'Some Subject',

        ],

        body =3D> $html,

);

=20

my $sender =3D Email::Send->new({mailer =3D> 'SMTP'});

$sender->mailer_args([Host =3D> 'tiger.georgetowncollege.edu']);

$sender->send($email);

                $html =3D "";

        }

}

close(DAT);

=20

Travis Hervey

Programmer Analyst

Georgetown College

400 East College Street

Georgetown KY, 40324

Tel: 1-502-863-8001

Fax: 1-502-686-8884

Email: travis_hervey@georgetowncollege.edu=20

=20


------_=_NextPart_001_01C7D5F2.CEEC49EF--
0
Travis_Hervey
8/3/2007 5:22:11 PM
perl.beginners 29332 articles. 3 followers. Follow

1 Replies
1132 Views

Similar Articles

[PageSpeed] 13

--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri Aug  3 13:22:11 2007, Travis Hervey wrote:
> I am using the Email::MIME:CreateHTML module to send html formatted
> emails.  It all works fine until I try to change the "To" line to a
> scalar so that I can mass mail to different individuals.  Has anyone
> used this module in a manner like this before?  Thanks,
>=20
> my $email =3D travis_hervey@georgetowncollege.edu;
>=20
> while(<DAT>)
>=20
> {
>=20
>         $line =3D TRIM($_);
>=20
>         $html =3D $html . $_;
>=20
>         if($line eq "</body>")
>=20
>         {
>=20
> my $email =3D Email::MIME->create_html(
>=20
>         header =3D> [
>=20
>                 From =3D> 'travis_hervey@georgetowncollege.edu',
>=20
>                 To =3D> '$email',
>=20
>                 Subject =3D> 'Some Subject',
>=20
>         ],
>=20
>         body =3D> $html,
>=20
> );
>=20
> =20
>=20
> my $sender =3D Email::Send->new({mailer =3D> 'SMTP'});
>=20
> $sender->mailer_args([Host =3D> 'tiger.georgetowncollege.edu']);
>=20
> $sender->send($email);
>=20
>                 $html =3D "";
>=20
>         }
>=20
> }
>=20
> close(DAT);
>=20
> =20

get rid of the single quotes around $email. a variable inside single quotes=
 is just text. a variable inside double quotes will do what you expect.

d.

--=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
$mysig =3D <<EOS;
while(1){
    ....
}

dani=EBl <daniel@0x64.nl>, <devogon@gmail.com>
http://0x64.nl
gmail talk: devogon

EOS

--0OAP2g/MAC+5xKAE
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.5 (GNU/Linux)

iD8DBQFGs2uwfQZ5VDeORdkRAjIJAJ9R5ljzbB88TImhaXgN+jfBZovJXACfeDPY
M7dM+sHj1lNdL/6JOqFj9zk=
=A3gr
-----END PGP SIGNATURE-----

--0OAP2g/MAC+5xKAE--
0
devogon
8/3/2007 5:53:52 PM
Reply:

Similar Artilces:

A problem to send email using Smtp
I have a proble to send an email from asp.net I do the following code to send an email: MailMessage mail=new MailMessage(); mail.From="test@server.com"; mail.To="myemailaddress@server.com"; mail.BodyFormat=MailFormat.Html; mail.Subject="testing..."; mail.Body="cool"; SmtpMail.SmtpServer="localhost"; SmtpMail.Send(mail); But I dont' receive an email when I use this method. Why is that? How can I send an email? Thanks in advance! check and see if.. -your client-side code has no errors -you imported the S...

Creating Email Alias which would send email to select email accounts using HMC 4.0
Hello all,   I was wondering what is the best method of creating a email alias in exchange 2007. I tried using exchange 2007 console, but it seems the only way is to add the smtp address to each user. I did try a group, but it add's the default smtp address which I do not want there, and it complains when I try to remove it. I was wondering if there is a way from provision or exchange console....

How can I send an HTML format email using send mail
Does anyone know how to send an HTML formatted email using sendmail. I can send plain text email OK. If I format the message using HTML the message shows the HTML tags. I can't find any information regarding this on cpan. Are there any other modules that have this capability? Any help is greatly appreciated. Jeff I've sent you a private message with a script. I didn't think it would be appropriate to post that much code to the list. Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com ----- Original Message ----- From: "jeff" <we...

Using Email Interface
Hi-- I recently set up a version of Bugzilla for my company (v 3.0.2) and I want to use the email interface so I can submit bugs via email. I know how to format an email in order to do this, but I don't know what email address to send it to. Where do I find this email address/how can I set it up? Thanks rmandal@gmail.com wrote: > Hi-- > > I recently set up a version of Bugzilla for my company (v 3.0.2) and I > want to use the email interface so I can submit bugs via email. I know > how to format an email in order to do this, but I don't know what &g...

Using ALTAS to Send Email (Email Form)
Hello all. I have yet to find anywhere an example on how one might use the underlying ATLAS API (not the fancy controls that come with it) to send a simple email from a simple webform. Can anyone point one out for me? Or maybe someone has an example tucked away somewhere that they might want to let out ino the public? Thanks,Andrew There is nothing special about sending e-mail with "Atlas". On the client you can use a link with the "mailto:" pseudo protocol, to fire up the default e-mail client. See mailto protocol for more information.On the server you can use the features in the Syste...

hide email addresses from email after using smtp.send()
hello , I have some kind of subscribe feature , the emails are saved in database so am using a sqldatareader and a loop , inside loop am adding the emails with msg.to.add() , but what is happening that all the emails are being shown ( in the to place) when a subscriber receives an email , but I dont want that , cause the subscriber shall not know email addresses of other subscribers , how to fix this thing ?!? thanks alot place all the recipients on the BCC of the email. this prevents them from seeing the email of other BCC recipients  Mike Banavige~~~~~~~~~~~~Need...

email in asp using CDONTS... cant send email
HELP!!! PLS!! I NEED REPLY NOW!! OR AS SOON AS POSSIBLE PLEASE.... IM DEVELOPING A WEBSITE USING ASP... in DREAM WEAVER... MS ACCESS DATABASE... MY OS IS WINDOWS XP PRO.... I CANT SEND AN EMAIL... I TEST MY WEBSITE USING IIS.. I HAVE AN INTERNET CONNECTION... CAN I POSSIBLY SEND AN EMAIL?? THERE IS AN ERROR WHEN I TRIED TO TEST SENDING AN EMAIL... IM ONLY USING ASP... NOT ASP .NET  Error Type:Microsoft VBScript runtime (0x800A01AD)ActiveX component can't create object: 'CDONTS.NewMail' WHAT DOES IT MEAN?? HELP PLEASE.... WHAT SHOULD I DO?? WHAT ARE THE REQUIREMENTS.... PLEASE HELP....

Use the email adress in the users profile to send an email
Hi, hope you cn help me. I am using the createuserwizard to create new users. In this template the users are asked for their email adress. All is working fine, but how can I use the email adress the user entered during registration later in a session to send him an email? I thought just "profile.email", but its wrong.   Hope you can help me, Chrissi Hi Chrissi, When you use the CreateUserWizard, you're creating a user through the current membership provider, which is different than Profiles.  To get a user's email, tryDim myUser As System.Web.Security.Mem...

Sending Email using HTML file as Emailbody using Net.Mail.MailMessage... Please help
Hi all I can send emails with text or html emailbody using asp.net, but cannot find any method or example so far on the web to show how to use an html file as an emailbody. I have tried everything. I know how to do it with the old asp. I have created a html document for example newsletter.html. I want this document to be in the email body when the client opens the email. It must not load from another url. I suppose what i want to do is embed it into the email.Any help or examples will be appreciated as this is quite urgent for me to implement it for my client.  This is the code im ...

how to get the correct email format when sending email using sqldatareader
I'm getting the email address from an excel sheet.But i need to send the email to multiple peopleWhen printing the below i geta@a.com;b@b.com;; But i want a@a.com;b@b.com; i don't need the extra semicolon Thanks code below------ while (oledr.Read()) { smail = oledr[0].ToString() + ";" + "<br>";   //smail += oledr[0].ToString() & ";"; //mail.To.Add(smail); //this.Label1.Text = smail; Response.Write(smail); }   If oledr[0].ToString() contains only one email address (and not a few), then you can do it this way:while (oled...

Get email address from DB and send email using VB
OK every time I figure something out on my own, there's 10 more things I can't seem to figure out. I feel like a VB moron. Ha. Anyway. Here's what I need to do...1. Retrieve the email addresses from my database table of people whose memberships to my organization has expired in the past month.2. Somehow plug those email addresses into a code to send them a prewritten, preformatted email.I have found an article on how to send an email using VB coding. I just don't know how I would send one email to every person whose membership has expired in the past month. Ideally, I'd like to be able to lo...

Sending Emails using the html pages
    I know that we can use the MailMessage class in aspx pages but what if the page is html. How can we send an email from the html page? HighOnCodingWanna get high! Most web hosts will have a CGI mail script that you can use. What you do is post your form to a location such as http://yourhost.com/cgi-bin/mail Your form will have hidden fields such as:    <input type="hidden" name="from" value="azamsharp@hotmail.com" />   <input type="hidden" name="successpage" value="thankyou.html" />Check the website of your host; this information...

Send email by using email set at google app (URGENT)
Hi there,  Currently I facing a problem to send email out.right now my customer email has been pointed to use google apps, then i trying to send email use it. but i am getting this message for port 587 "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first." and "The operation has be timed out" for port 467.I have enable the SSL, but I still getting the same result.  Just read this forum post for few possible chances. http://www.userscape.com/helpdesk/index.php...

Mass Email sending or Bulk sending email
  i have a Problem regarding Email sending ie : Bulk sending mails --> let me explain Clearly i have an excel sheet in that there are around 3000 Records and in that each and ever record has a unique email id( it can be either gmail , yahoo. or hotmail )so , now i need a soluction for how to send a Bulk email at a timeas i told earlier  , each record contain Unique email id , so i need to send email for individual recodes in excel with appropriate record data  for the above probm , i have writen a program with foreach loop --> it is like, i have taken a co...

Web resources about - Sending HTML Email Using EMAIL::MIME::CreateHTML - perl.beginners

Resources last updated: 12/30/2015 6:06:19 AM