Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

asp to PHP

Participant ,
Aug 22, 2008 Aug 22, 2008
I use Dreamweaver CS3 and have an email extension from WebAssist

My problem is sending email file attachments with PHP. I have been using ASP and am switching to PHP.
this is the code for the email file attachment that works in ASP
WA_MailObject = WAUE_AddAttachment(WA_MailObject,"" & cStr(Server.MapPath("/PDF")) & "\200LX.pdf")

I can't seem to translate to PHP and get it to work. What would the PHP equivalent be for
& cStr(Server.MapPath("/PDF")) & "\200LX.pdf")

thanks
for any help
TOPICS
Server side applications
578
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 23, 2008 Aug 23, 2008
JBWebWorks wrote:
> What would the PHP
> equivalent be for
> & cStr(Server.MapPath("/PDF")) & "\200LX.pdf")

There isn't one. The PHP mail() function does not support attachments.

To send attachments with mail by PHP, you need to use a PHP class. There
are several about: PEAR Mail and Mail_Mime, the Zend Framework,
phpMailer, etc.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 24, 2008 Aug 24, 2008
Thanks David.

I found out something i was doing wrong with the WebAssist emailer; the file i want to send as an attachment is in the same folder as the page sending the email. I had put in the path as /PDF/200LX.pdf when it should be just 200LX.pdf. So the PHP code became
$WA_MailObject = WAUE_AddAttachment($WA_MailObject,"200LX.pdf"); //which works
instead of
$WA_MailObject = WAUE_AddAttachment($WA_MailObject,"/PDF/200LX.pdf"); //which doesn't work

A different problem now
The email sends but the attachment comes in .dat versus the .pdf
I have googled the poblem and find that it is a known problem but information gears toward Outlook.
Can't find anything about server generated emails.

Any suggestions?

PS- I like your books
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 24, 2008 Aug 24, 2008
JBWebWorks wrote:
> A different problem now
> The email sends but the attachment comes in .dat versus the .pdf

It's a WebAssist extension that you're working with. I don't have the
extension, so I've no idea what code they're using. However, the issue
is obviously a MIME problem. How you fix it depends on how the WebAssist
code is attaching the file.

> PS- I like your books

Thank you.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 25, 2008 Aug 25, 2008
Dave

I can't seem to get the answer from Web Assist, but it is a MIME problem according to others in the webassist forum who have the same problem.
Would you mind looking at the mailformatting page code and see if you can see an obvious problem?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 25, 2008 Aug 25, 2008
JBWebWorks wrote:
> I can't seem to get the answer from Web Assist, but it is a MIME problem
> according to others in the webassist forum who have the same problem.
> Would you mind looking at the mailformatting page code and see if you can see
> an obvious problem?

None of the code you posted has anything to do with setting MIME values
for attachments. If others are having problems with attachments, it's
probably something you should submit to WebAssist as an enhancement request.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 25, 2008 Aug 25, 2008
Thanks David

I submitted a support incident to Web Assist today.

There are four seperate PHP pages related to sending the email with attachment and the code i had attached was from one.
Would you be willing to look at the other code?
If not, I surely understand.

thanks again,
Jim Balthrop
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 26, 2008 Aug 26, 2008
JBWebWorks wrote:
> There are four seperate PHP pages related to sending the email with attachment
> and the code i had attached was from one.
> Would you be willing to look at the other code?
> If not, I surely understand.

Since that code is part of a commercial extension sold by WebAssist, I
don't think it's really appropriate. If I were a WebAssist customer who
had also bought it, the situation would be different.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 26, 2008 Aug 26, 2008
LATEST
>Since that code is part of a commercial extension sold by WebAssist, I
>don't think it's really appropriate. If I were a WebAssist customer who
>had also bought it, the situation would be different.

Thanks for your response, David
I will pursue with Web Assist and I hope they can figure it out. As I said, I don't have the problem with ASP, just PHP; so I am thinking it has something to do with Microsoft Exchange Servers. I have read about problems with Outlook having this problem of changing attachments from original format to .dat
I have tested this with email service of Cox.net and have the .dat problem but tested with email service of Deltacom.net and do not have the problem.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines