I have the following code in an after validate event for a web page dialog. The process runs fine except the attachment gets renamed. Whatever the filename turns out to be based on the code below, the email function or the server will modify the attachment so that it will have .tgz appended to it. That makes an email program think it is an Zip file, when in fact is an Excel file. Obviously, the Zip program will not load it, so it has be saved and the filename changed.
I turned off the GZIP compression on the server, but that didn't make any difference
Thanks,
mike
session.vemail = alltrim(currentForm.Controls.Email_Address.value)
session.valid_email = eval_valid("session.vemail")
a_tbl = table.open("[PathAlias.ADB_Path]\prayer_chart.dbf")
query.order = "Num"
query.filter = "Wknd_Code = '" + var->vweekend_code + "'"
query.options = "I"
a_tbl.query_create()
export.type = 4
export.names = .T.
export.file = "C:\A5Webroot\cursillo\CursilloNew\files\prayer_chart_" +var->vmove +"-"+ var->vgen +"-"+ var->vwknd + ".xls"
export.options = ""
export.field_sep = ""
export.record_sep = ""
export.fields = 5
export.field1 = "daytitle"
export.field2 = "timebeg"
export.field3 = "timeend"
export.field4 = "name"
export.field5 = "weekend"
a_tbl.export()
a_tbl.close()
if session.valid_email then
message.to = session.vemail
message.from_Alias = "Cursillo Web Access"
message.from = "[email protected]"
if vgen = "W" .or. vgen = "F" then
message.subject = "Prayer Chart for Women's Weekend " + vwknd + "."
end if
if vgen = "M" then
message.subject = "Prayer Chart for Men's Weekend " + vwknd + "."
end if
if vgen = "C" then
message.subject = "Prayer Chart for Weekend " + vwknd + "."
end if
message.Attachments = export.file
message.message = "Prayer Chart is attached"
email_send2(message, "Cursillo")
end if
I turned off the GZIP compression on the server, but that didn't make any difference
Thanks,
mike
session.vemail = alltrim(currentForm.Controls.Email_Address.value)
session.valid_email = eval_valid("session.vemail")
a_tbl = table.open("[PathAlias.ADB_Path]\prayer_chart.dbf")
query.order = "Num"
query.filter = "Wknd_Code = '" + var->vweekend_code + "'"
query.options = "I"
a_tbl.query_create()
export.type = 4
export.names = .T.
export.file = "C:\A5Webroot\cursillo\CursilloNew\files\prayer_chart_" +var->vmove +"-"+ var->vgen +"-"+ var->vwknd + ".xls"
export.options = ""
export.field_sep = ""
export.record_sep = ""
export.fields = 5
export.field1 = "daytitle"
export.field2 = "timebeg"
export.field3 = "timeend"
export.field4 = "name"
export.field5 = "weekend"
a_tbl.export()
a_tbl.close()
if session.valid_email then
message.to = session.vemail
message.from_Alias = "Cursillo Web Access"
message.from = "[email protected]"
if vgen = "W" .or. vgen = "F" then
message.subject = "Prayer Chart for Women's Weekend " + vwknd + "."
end if
if vgen = "M" then
message.subject = "Prayer Chart for Men's Weekend " + vwknd + "."
end if
if vgen = "C" then
message.subject = "Prayer Chart for Weekend " + vwknd + "."
end if
message.Attachments = export.file
message.message = "Prayer Chart is attached"
email_send2(message, "Cursillo")
end if
Comment