منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : ارسال بريد اليكترونى بتنسيق جدول
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السادة الزملاء الافاضل

السلام عليكم ورحمة الله وبركاته .

قمت بعمل برنامج للشركة التى أعمل بها و هو يعمل جيداً و لله الحمد، ويقوم البرنامج بارسال ايميل عند تغيير البيانات او عند الموافقه على طلب ما من الرئيس المسئول كما فى الكود التالى

كود :
With Contacts
           .Data1.RecordSource = " select * from Contacts where UnitNames like '" & TdepartmentNameDB.Text & "*" & "'"
           .Data1.Refresh
                       TDepartment.Text = .DBGrid1.Columns(1).Text
                       TUnitNames.Text = .DBGrid1.Columns(2).Text
                       TIssuedName.Text = .DBGrid1.Columns(3).Text
                       TIssuedEmail.Text = .DBGrid1.Columns(4).Text
                       TDelegationTo.Text = .DBGrid1.Columns(11).Text
                       TAdministration.Text = .DBGrid1.Columns(24).Text
                       TDelegationToName.Text = .DBGrid1.Columns(11).Text
                       IssuedDelegationName.Text = .DBGrid1.Columns(5).Text
                       IssuedDelegationEmail.Text = .DBGrid1.Columns(6).Text
                       MechanicalSection.Text = .DBGrid1.Columns(13).Text
                       ElectricalSection.Text = .DBGrid1.Columns(14).Text
                       WeldingSection.Text = .DBGrid1.Columns(15).Text
                       VehiclesSection.Text = .DBGrid1.Columns(16).Text
                           PM2Names.Text = .DBGrid1.Columns(25).Text
                       ProdPM2.Text = .DBGrid1.Columns(26).Text
                           PM3Names.Text = .DBGrid1.Columns(27).Text
                       ProdPM3.Text = .DBGrid1.Columns(28).Text
                           PM4Names.Text = .DBGrid1.Columns(29).Text
                       ProdPM4.Text = .DBGrid1.Columns(30).Text
                           DeInkingName.Text = .DBGrid1.Columns(31).Text
                       ProdDeInking.Text = .DBGrid1.Columns(32).Text
                           GeneralName.Text = .DBGrid1.Columns(33).Text
                       ProdGeneral.Text = .DBGrid1.Columns(34).Text
End With
Text24.Text = ""
On Error Resume Next
Dim linecount As Long
If TDepartment.Text = "Production" Then
           If TLine = "PM2" Or TLine.Text = "Winder2A" Or TLine.Text = "Winder2B" Then
                   Text24.Text = " Dear Mr. " & PM2Names.Text & " " & " ,   " & "  " & IssuedDelegationName.Text & ""
               End If
                   If TLine.Text = "PM3" Or TLine.Text = "Winder3" Then
                           Text24.Text = " Dear Mr. " & PM3Names.Text & " " & " ,   " & "  " & IssuedDelegationName.Text & ""
                       End If
                                           If TLine.Text = "General" Or TLine.Text = "C-PM2/PM3/PM4" Then
                                                   Text24.Text = " Dear Mr. " & GeneralName.Text & " " & " ,   " & "  " & IssuedDelegationName.Text & ""
                                               End If
       Text24.Text = " " & Text24.Text & vbNewLine & ""
       Text24.Text = " " & Text24.Text & vbNewLine & "               " & "Kindly Below is RRS Issued By Your Department, And Maintenance Department Receive it, By :  " & Text19.Text & " , And Now Task In Planning "
       Text24.Text = " " & Text24.Text & vbNewLine & "                           -      " & "RRS #   " & TRRS.Text & "  " '    With Status :    " & TMaintenanceSatus.Text & " "
       Text24.Text = " " & Text24.Text & vbNewLine & "                           -      " & "Description :       " & TActionTaken.Text & ""
       Text24.Text = " " & Text24.Text & vbNewLine & "                           -      " & "Maintenance Section  :    " & Combo8.Text & "       -    " & "  Shift   :   " & Combo1.Text & "  "
       Text24.Text = " " & Text24.Text & vbNewLine & "                           -      " & "Receive Time  :    " & MB2.Text & " "  '      -    " & "  Shift   :   " & TShift.Text & "  "
       Text24.Text = " " & Text24.Text & vbNewLine & "                           -      " & "Receive Comment  :    " & Text6.Text & "       -    " & "  and It's Issue Task # :   " & Text21.Text & "   - @    " & MB2.Text & ""
       Text24.Text = " " & Text24.Text & vbNewLine & ""
       Text24.Text = " " & Text24.Text & vbNewLine & " This Message Was Sent Automatically by Maintenance System Programs, Don't Reply This Message"
       Text24.Text = " " & Text24.Text & vbNewLine & ""
       Text24.Text = " " & Text24.Text & vbNewLine & "Powered By Maintenance System Program"
       Text24.Text = " " & Text24.Text & vbNewLine & " ------------------------------------------------------- "
Else

           Text24.Text = " Dear Mr. " & TIssuedName.Text & " " & " ,   " & "  " & IssuedDelegationName.Text & ""
           Text24.Text = " " & Text24.Text & vbNewLine & ""
           Text24.Text = " " & Text24.Text & vbNewLine & "               " & "Kindly Below is RRS Issued By Your Department, And Maintenance Department Receive it, By :  " & Text19.Text & " , And Now Task In Planning "
           Text24.Text = " " & Text24.Text & vbNewLine & "                           -      " & "RRS #   " & TRRS.Text & "  " '    With Status :    " & TMaintenanceSatus.Text & " "
           Text24.Text = " " & Text24.Text & vbNewLine & "                           -      " & "Description :       " & TActionTaken.Text & ""
           Text24.Text = " " & Text24.Text & vbNewLine & "                           -      " & "Maintenance Section  :    " & Combo8.Text & "       -    " & "  Shift   :   " & Combo1.Text & "  "
           Text24.Text = " " & Text24.Text & vbNewLine & "                           -      " & "Receive Time  :    " & MB2.Text & " "  '      -    " & "  Shift   :   " & TShift.Text & "  "
           Text24.Text = " " & Text24.Text & vbNewLine & "                           -      " & "Receive Comment  :    " & Text6.Text & "       -    " & "  and It's Issue Task # :   " & Text21.Text & "   @    " & MB2.Text & ""
           Text24.Text = " " & Text24.Text & vbNewLine & ""
           Text24.Text = " " & Text24.Text & vbNewLine & " This Message Was Sent Automatically by Maintenance System Programs, Don't Reply This Message"
           Text24.Text = " " & Text24.Text & vbNewLine & ""
           Text24.Text = " " & Text24.Text & vbNewLine & "Powered By Maintenance System Program"
           Text24.Text = " " & Text24.Text & vbNewLine & " ------------------------------------------------------- "
End If
           Dim objOutlook As Object
           Dim objOutlookMsg As Object
           Set objOutlook = CreateObject("Outlook.Application")
           Set objOutlookMsg = objOutlook.CreateItem(0)
           With objOutlookMsg
If TDepartment.Text = "Production" Then
                   If TLine.Text = "PM2" Or TLine.Text = "Winder2A" Or TLine.Text = "Winder2B" Then
                          .To = ProdPM2.Text
                   End If
                   If TLine.Text = "PM3" Or TLine.Text = "Winder3" Then
                          .To = ProdPM3.Text
                   End If
                   If TLine.Text = "General" Or TLine.Text = "C-PM2/PM3/PM4" Then
                          .To = GeneralName.Text
                   End If
   If Combo8.Text = "Mechanical" Then
               .Cc = MechanicalSection.Text
       End If
   If Combo8.Text = "Electrical" Then
               .Cc = ElectricalSection.Text
       End If
   If Combo8.Text = "Welding" Then
               .Cc = WeldingSection.Text
       End If
   If Combo8.Text = "Vehicles" Then
               .Cc = VehiclesSection.Text
           End If
               .Subject = " RRS #   " & TRRS.Text & "   Now Receive By    " & Text19.Text & "  -  and It's Issue Task # :  " & Text21.Text & "   - @    " & MB2.Text & " "
               .Body = Text24.Text
               .Send  'Let´s go!
               Set objOutlookMsg = Nothing
               Set objOutlook = Nothing
Else
               .To = TIssuedEmail.Text
   If TSection.Text = "Mechanical" Then
               .Cc = MechanicalSection.Text
       End If
   If TSection.Text = "Electrical" Then
               .Cc = ElectricalSection.Text
       End If
   If TSection.Text = "Welding" Then
               .Cc = WeldingSection.Text
       End If
   If TSection.Text = "Vehicles" Then
               .Cc = VehiclesSection.Text
           End If
               .Subject = " RRS #   " & TRRS.Text & "   Now Receive By    " & Text19.Text & "  -  and It's Issue Task # :  " & Text21.Text & "   - @    " & MB2.Text & " "
               .Body = Text24.Text
               .Send  'Let´s go!
               Set objOutlookMsg = Nothing
               Set objOutlook = Nothing
End If
           End With
           Exit Sub
End Sub  
thanks a lot

ولكن طلب منى مديرى ارسال هذا اليميل بتنسيق مثل الجدول كما فى الصورة المرفقة ؟

ولكن بحثت كثيراً على جوجل و كثير من المواقع ولكن لم أجد ضالتى بها. فهل اجد أحد منكم يساعدنى او يقوم بالتعديل بالكود السابق الذكر.
بارك الله فيكم وفى الجميع.
[attachment=7010]
ارفق المثال كي اقوم بالمحاولة في التعديل عليه او يقوم أحد المبرمجين بالتعديل عليه
هذا هو مثال مبسط لما اقوم به .

تجد هناك ذر باسم "Send E-mail" عندما اضغط عليه يرسل الايميل ولكن بتنسيق النصى كما سترى فى المثال.

فهل اجد من يقوم بالتعديل عليه ليرسل الايميل بتنسيق جدول كما فى الصورة المرفقة سابقا.

بارك الله فيكم جميعاً وذادكم علماً.


[attachment=7032]
اخوانى الاعزاء

توصلت لطريقة تصميم الجدول و البيانات بلغه HTML مثل الكود التالى .

ولكننى فشلت فى ادماجة فى المشروع . فهل يساعدنى احد الزملاء
او اى افكار اخرى ستكون موضع تقدير.

بارك الله فى الجميع .

كود :
<body>

<h1>Dears Mr. XXXXXXXXXXXXXXXXXXXX </h1>
<h2>PRS#</h2>

<p>
Kindly as per estimated delivery date, please confirm to us is it done or still in process?</p>

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
   border: 2px solid MediumSlateBlue;
   text-align: left;
}
</style>
</head>
<body>

<table style="width:100%">
 <tr>



   <th>PRS#</th>
   <th>Item Code</th>        
   <th>Est. Delivery Date</th>
   <th>Task#</th>
   <th>Task Status</th>
   <th>Line</th>
 </tr>

 <tr>




   <td>1000</td>
   <td>120-230-3265PA</td>        
   <td>16/07/2015</td>
   <td>70201</td>
   <td>Waiting For Materials</td>
   <td>PM3</td>
 </tr>
 <tr>
   <td>120</td>
   <td>36950PMERT</td>        
   <td>01/01/2017</td>
   <td>80391</td>
   <td>Waiting For Materials</td>
   <td>PM2</td>

 </tr>
</table>

</body>
</html>

</section>

<footer>
<p>&copy; This Message Was Sent Automatically by Maintenance System Programs, Wait your feedback!.</p>
<p>Powered By Maintenance System Program - MPS.</p></footer>

</body>
</html>



[attachment=7041]
اهلا , هذا مثال يوضح , طريقة إرسال رسالة بتنسيق html .
جزاكم الله خيراً أخى أحمد و بارك الله فيك

جارى تجربته وان شاء الله يصلح للعمل معى .

زادكم الله علماً.